Example #1
0
 /// <summary>
 /// Opens the native gallery for an image and returns its path to the specified callback.
 /// </summary>
 public static void PickImage(CropOption cropOption, ImageResultHandler callback)
 {
     if (I == null)
     {
         RenLog.Log(LogLevel.Warning, "GalleryPicker.PickImage - You must initialize this module first!");
         return;
     }
     I.onImageResult = callback;
     I.galleryPlugin.PickImage(cropOption);
 }
Example #2
0
        /// <summary>
        /// Takes a new photo and saves at specified file path.
        /// On iOS, the photo will be saved to the library along with documents directory,
        /// as you can't directly access files in the photo library.
        /// </summary>
        public static void TakePhoto(SaveOption saveOptions, CropOption cropOptions, PhotoResultHandler callback)
        {
            if (I == null)
            {
                RenLog.Log(LogLevel.Warning, "NativeCamera.TakePhoto - You must initialize this module first!");
                return;
            }
            if (saveOptions == null)
            {
                saveOptions = new SaveOption();
            }
            if (cropOptions == null)
            {
                cropOptions = new CropOption();
            }

            I.onPhotoResult = callback;
            I.camPlugin.TakePhoto(saveOptions, cropOptions);
        }