Usage
Once you have enabled the required features that you are going to use in Media Services, you can start using the API by importing the namespace.
Once after importing the namespace, all features within Media Services can be accessed through MediaServices class.
Before accessing any gallery features, you need to check if your app have access to gallery.
Get read status
Get read/write status
Once you know the status and you don't have the permission, you can request the access. This request will popup a dialog to let user allow the permission.
Request gallery access for Read mode
Request gallery access for ReadWrite mode
Read camera access
Get images from Gallery or Camera
For getting the images from gallery, you need read access(GalleryAccessmode.Read) to gallery. Once you have the access, you can call SelectImageFromGallery which can return the texture data in the callback.
canEdit flag will be ignored on Android where as on iOS it opens up an option to edit the image allowing it to crop.
For capturing an image from device camera, you need camera permission which can be gained with RequestCameraAccess method. Once you have the permission, you can call CaptureImageFromCamera method.
For fetching the images with permission, you can use utility methods SelectImageFromGalleryWithUserPermision and CaptureImageFromCameraWithUserPermision.
Save image to gallery
You need to have read-write access for saving images to gallery. For requesting access you need to call RequestGalleryAccess with GalleryAccessmode.Read mode. Once you have the permission, you need to call SaveImageToGallery by passing the image texture.
Last updated