Camera and Gallery

The camera and gallery API allow you to read images from camera and gallery, and save an image from your app to the device gallery.


Saving Texture2D to the gallery.

Note: Texture Should be marked as readable.



or you can save the app screenshot using



The example how to listener for image save event:

UM_Camera.instance.OnImageSaved += OnImageSaved;

void OnImageSaved (UM_ImageSaveResult result) {
       if(result.IsSucceeded) {
           //no image path for IOS
           new MobileNativeMessage("Image Saved", result.imagePath);
       } else {
           new MobileNativeMessage("Failed", "Image Save Failed");


Getting Texture2D from Camera or Gallery.

Subscribe to the image load event:

UM_Camera.instance.OnImagePicked += OnImage;


Then retrieve the image with





Example if data retrieving when OnImage action fired

private void OnImage (UM_ImagePickResult result) {
       if(result.IsSucceeded) {
           darawTexgture = result.image;
       UM_Camera.instance.OnImagePicked -= OnImage;


Note: Managing multiple full-sized images can be tricky with limited memory. If you find your application running out of memory after displaying just a few images, you can dramatically reduce the amount of dynamic heap used by expanding the JPEG into a memory, by setting low max image size. This settings with the other Gallery settings can be found under the “Camera And Gallery” menu in the Ultimate Mobile Plugins Settings.

Window → Ultimate Mobile → Edit Settings



Warning: After you done using loaded texture (for example user going to load another one instead) do not forget to destroy with the Unity Destroy method it as in the code snippet bellow, or it may cause memory leak.

Texture2D myOldTexture;