Preparing search index...
    • Opens the device's image gallery to select a photo

      Allows users to pick an image from their device's photo gallery with built-in cropping functionality. Returns the file path of the selected and cropped image.

      Parameters

      • themeColors: MD3Colors

        React Native Paper theme colors for UI consistency

      Returns Promise<string>

      Promise resolving to the file path of selected image, or empty string if cancelled

      const { colors } = useTheme();
      const imagePath = await pickImage(colors);

      if (imagePath) {
      console.log(`Image selected: ${imagePath}`);
      // Process the selected image
      } else {
      console.log('User cancelled image selection');
      }