Preparing search index...

    Function takePhoto

    • Opens the device's camera to capture a new photo

      Captures an uncropped photo, then crops it through cropImage so the result keeps full resolution (the native cropper would otherwise shrink it on iOS). Returns the file path of the cropped image.

      Parameters

      • themeColors: MD3Colors

        React Native Paper theme colors for UI consistency

      Returns Promise<string>

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

      const { colors } = useTheme();
      const photoPath = await takePhoto(colors);

      if (photoPath) {
      console.log(`Photo captured: ${photoPath}`);
      // Process the captured photo
      } else {
      console.log('User cancelled photo capture');
      }