Interface IDeviceGallery
Entry interface to use native device's Gallery APIs.
Namespace: EasyMobile
Assembly: cs.temp.dll.dll
Syntax
public interface IDeviceGallery
Methods
LoadImage(MediaResult, Action<String, Texture2D>, Int32)
Load image from MediaResult.
Declaration
void LoadImage(MediaResult media, Action<string, Texture2D> callback, int maxSize = -1)
Parameters
Type | Name | Description |
---|---|---|
MediaResult | media | Target result, note that this method only work if the Type equals Image. |
System.Action<System.String, Texture2D> | callback | Callback called when the image is loaded. Param 1: Error, null means the image has been loaded successfully. Param 2: Loaded image, null if there's error. |
System.Int32 | maxSize | Maximum size of the image. Load fullsize if non-positive. |
Pick(Action<String, MediaResult[]>)
Pick item(s) from gallery.
Declaration
void Pick(Action<string, MediaResult[]> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.String, MediaResult[]> | callback | Callback called when user finish picking and return to Unity. Param 1: Error, null means success. Param 2: All the picked items, null if there's an error. |
SaveImage(Texture2D, String, ImageFormat, Action<String>)
Save an image into gallery.
Declaration
void SaveImage(Texture2D image, string name, ImageFormat format = ImageFormat.JPG, Action<string> callback = null)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | image | The image you want to save. |
System.String | name | Image will be saved with this name. |
ImageFormat | format | The image will be saved in this format. |
System.Action<System.String> | callback | Callback called after the image is saved. Param: Error, null means success. |