iOS Load Texture From PhotoLibrary/Camera

White Dev

(28)
$9
Publisher White Dev
File size 449.86kB
Number of files 23
Latest version 1.8.2
Latest release date 2018-06-04 04:31:30
First release date 2013-07-02 06:57:17
Supported Unity versions 2018.4.2 or higher
This plugin is run on iOS native code. You can use UIImagePicker for load a texture on Unity.

Note:
Must add two keys to Info.plist to work in iOS 10.
- NSPhotoLibraryUsageDescription
- NSCameraUsageDescription

New Feature:
- Added functions to Save/Load to local storage as png file.
It's to enable to resume with the last selected image.

Features:
- Load Texture from PhotoLibrary on Device
- Take a photo by Camera
- Save Image to PhotoLibrary (JPG/PNG/PNG with transparency)


Demo Video

How to use (C# Script):

ShowCamera:
LoadTextureFromImagePicker.ShowCamera(gameObject.name, "OnFinishedImagePicker");

Load Image from PhotoLibrary:
LoadTextureFromImagePicker.ShowPhotoLibrary(gameObject.name, "OnFinishedImagePicker");

Callback function on finished, and get Image:
private void OnFinishedImagePicker (string message) {
Texture2D texture = LoadTextureFromImagePicker.GetLoadedTexture(message, 512, 512);
targetMaterial.mainTexture = texture;
}


Save Image to PhotoLibrary:
LoadTextureFromImagePicker.SaveAsJpgToPhotoLibrary(image, gameObject.name, "OnFinishedSaveImage");


Support: [email protected]