The Photo Library API enables you to interact with the photo gallery of the device.
As the CameraAPI external object enables an app to interact with the photo camera of the device, this API allows the application to save or get an image from the native photo gallery.
This article focuses on what this API does and gives an example of how to use it in a Smart Device API.
The API has one external object as the image shows.
||This method invokes the native photo gallery app and lets the user choose one image to use in the application.
||The Save method enables the application to store an image on the device's native photo gallery application.
There are three cases of different types of images for which the save method can be used.
a. To save an image from the DB (attribute)
b. To save an image from an URL(ImageVariable.FromURL(url))
c. To save an image just taken with the camera (CameraAPI)
Create the following Panel for Smart Devices object.
&getFromLibrary = PhotoLibraryAPI.ChooseImage()
&saveToLibFromWeb -> Image data type
&getFromLibrary -> Image data type
When the GetImage method is invoked:
The SaveImage method has no UI interaction to show, but the result of the execution is the image of the url saved on the device's photo gallery.
- Implemented in iOS for GeneXus X Evolution 2 Upgrade 1 and later.
- Implemented in Android and Black Berry for GeneXus X Evolution 2 Upgrade 2 and later.