captureImage (Client API reference)
Applies to Dynamics 365 for Customer Engagement apps version 9.x
Invokes the device camera to capture an image.
|imageOptions||Object||No||An object with the following attributes:
- allowEdit: Indicates whether to edit the image before saving. Boolean.
- height: Height of the image to capture. Number.
- preferFrontCamera: Indicates whether to capture image using the front camera of the device. Boolean.
- quality: Quality of the image file in percentage. Number.
- width: Width of the image to capture. Number..
|successCallback||Function||Yes||A function to call when image is returned. A base64 encoded image object with the following attributes is passed to the function:
- fileContent: Contents of the image file. String
- fileName: Name of the image file. String.
- fileSize: Size of the image file in KB. Number.
- mimeType: Image file MIME type. String.
|errorCallback||Function||Yes||A function to call when the operation fails.|
On success, returns a base64 encoded image object with the attributes specified earlier.
This method is supported only for the mobile clients.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.