/// <summary> /// Returns a Boolean value that indicates whether a given camera is available. /// </summary> /// <param name="cameraDevice">A IosImagePickerCameraDevice constant indicating the camera whose availability you want to check.</param> /// <returns><c>true</c> if the camera indicated by cameraDevice is available, or <c>false</c> if it is not available.</returns> public static bool IsCameraDeviceAvailable(IosImagePickerCameraDevice cameraDevice) { #if IOS_IMAGE_PICKER_NATIVE_IMPLEMENTATION_AVAILABLE return(PInvoke.UnityIosImagePickerController_IsCameraDeviceAvailable(cameraDevice)); #else return(false); #endif }
public static extern void UnityIosImagePickerController_Present( uint requestId, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerSourceType sourceType, string serializedMediaTypes, bool allowsEditing, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerVideoQualityType videoQuality, double videoMaximumDurationInSeconds, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerCameraDevice cameraDevice, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerCameraCaptureMode cameraCaptureMode, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerCameraFlashMode cameraFlashMode, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysUInt)] IosImagePickerPopoverArrowDirection ipadPopoverPermittedArrowDirections, float ipadNormalizedPopoverSourceRectX, float ipadNormalizedPopoverSourceRectY, float ipadNormalizedPopoverSourceRectWidth, float ipadNormalizedPopoverSourceRectHeight, bool ipadPopoverCanOverlapSourceRect);
/// <summary> /// Returns an array of IosImagePickerVideoCaptureMode indicating the capture modes supported by a given camera device. /// </summary> /// <param name="cameraDevice">A IosImagePickerCameraDevice constant indicating the camera you want to interrogate.</param> /// <returns>An array of IosImagePickerVideoCaptureMode indicating the capture modes supported by cameraDevice.</returns> public static IosImagePickerCameraCaptureMode[] AvailableCaptureModesForCameraDevice(IosImagePickerCameraDevice cameraDevice) { #if IOS_IMAGE_PICKER_NATIVE_IMPLEMENTATION_AVAILABLE var serializedCaptureModes = PInvoke.UnityIosImagePickerController_AvailableCaptureModesForCameraDevice(cameraDevice); if (serializedCaptureModes == null) { return(new IosImagePickerCameraCaptureMode[0]); } var rawCaptureModes = serializedCaptureModes.Split(SerializationSeparator); var captureModes = new System.Collections.Generic.List <IosImagePickerCameraCaptureMode>(); for (var i = 0; i < rawCaptureModes.Length; i++) { int parsedCaptureMode; if (int.TryParse(rawCaptureModes[i], out parsedCaptureMode)) { captureModes.Add((IosImagePickerCameraCaptureMode)parsedCaptureMode); } } return(captureModes.ToArray()); #else return(new IosImagePickerCameraCaptureMode[0]); #endif }
public static extern bool UnityIosImagePickerController_IsFlashAvailableForCameraDevice( [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerCameraDevice cameraDevice);
public static extern string UnityIosImagePickerController_AvailableCaptureModesForCameraDevice( [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.SysInt)] IosImagePickerCameraDevice cameraDevice);