iOS Load Texture From PhotoLibrary/Camera
White Dev
$11.00
Date |
Price |
---|---|
日時 |
価格($) |
05/31(2018) |
11.0 |
11/22(2024) |
11.0 |
Jump AssetStore
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: whitedev.support@gmail.com