Pick or Capture an Image

The samples below show how to quickly configure ISN_UIImagePickerController for common operations with an image. 

Pick an Image from Photo Library

using SA.iOS.UIKit;
using SA.iOS.AVFoundation;
...

ISN_UIImagePickerController picker = new ISN_UIImagePickerController();
picker.SourceType = ISN_UIImagePickerControllerSourceType.Album;
picker.MediaTypes = new List<string>() { ISN_UIMediaType.IMAGE};
picker.MaxImageSize = 512;
picker.ImageCompressionFormat = ISN_UIImageCompressionFormat.JPEG;
picker.ImageCompressionRate = 0.8f;

picker.Present((result) => {
    if (result.IsSucceeded) {
        Debug.Log("IMAGE local path: " + result.ImageURL);
        //Example how to assing thumbnail to Image m_image
        m_image.sprite = result.Image.ToSprite();
        //Example how to assing thumbnail to GameObject m_go;
        m_go.GetComponent<Renderer>().material.mainTexture = result.Image;
    } else {
        Debug.Log("Madia picker failed with reason: " + result.Error.Message);
    }
});

Capture an Image from Camera

ISN_UIImagePickerController picker = new ISN_UIImagePickerController();
picker.SourceType = ISN_UIImagePickerControllerSourceType.Camera;
picker.MediaTypes = new List<string>() { ISN_UIMediaType.IMAGE};
picker.MaxImageSize = 512;
picker.ImageCompressionFormat = ISN_UIImageCompressionFormat.JPEG;
picker.ImageCompressionRate = 0.8f;

picker.Present((result) => {
    if (result.IsSucceeded) {
        Debug.Log("IMAGE local path: " + result.ImageURL);
        //Example how to assing thumbnail to Image m_image
        m_image.sprite = result.Image.ToSprite();
        //Example how to assing thumbnail to GameObject m_go;
        m_go.GetComponent<Renderer>().material.mainTexture = result.Image;
    } else {
        Debug.Log("Madia picker failed with reason: " + result.Error.Message);
    }
});