-
How to capture image from front camera in backend on button click using phonegap?
about 9 years ago
-
almost 10 years ago
Hi,
You can solve it using Camera Picture Background plugin. This plugin allows you to capture image without any user interface. Install following plugin in your PhoneGap project :
cordova plugin add https://github.com/an-rahulpandey/cordova-plugin-camerapicturebackground.git
Now you have to add following code in your desired function :
var options = { name: "Image", //image suffix dirName: "myImages", //foldername orientation: "landscape", //or portrait type: "front" //or back }; window.plugins.CameraPictureBackground.takePicture(success, error, options); function success(imgurl) { console.log("Imgurl = " + imgurl); }
You will find this image under myImages folder in your device storage and you can display this image on your desired page.
Hope this will help you :) -

1 Answer(s)