14
Views
1
Comments
[CameraPreview Plugin] "takeSnapshot" Action not working
Question
Forge component by Daniel Martins
3
Published on 14 Aug 2019
Application Type
Mobile

Hi, I'm using the takeSnapshot action and it is not working properly, returning always a binary with 0 bytes.

takesnapshot1.png

mvp_badge
MVP
Rank: #17

Hi Milton,

In the latest version of this plugin the action is not called takeSnapshot, but takePicture. Also the implemented JavaScript is slightly different:

CameraPreview.setFlashMode($parameters.FlashMode);

CameraPreview.takePicture({width:$parameters.maxWidth, height:$parameters.maxHeight, quality:$parameters.Quality},function(base64PictureData){

    $parameters.PictureBase64HtmlTag = 'data:image/jpeg;base64,' +base64PictureData;

    $parameters.PictureBase64 = '' +base64PictureData;

    $resolve();

});

You can download a sample mobile application that implements the plugin from the following post (the one in the reply marked as solution), to see how to properly implement all functionality.

https://www.outsystems.com/forums/discussion/20252/example-usage/

Kind regards,

Daniel