Hello Readers,
Today's post is about we can capture screen shots in our Cordova / phoneGap application.
Well ! This Screenshot plugin provides the functionality that we can capture the screen shot of current screen and save it into device storage.
First of all we need to install plugin via Cordova CLI :
$ cordova plugin add https://github.com/gitawego/cordova-screenshot.git
Important : For iOS application this plugin supports only jpg format.
As i said, we can capture the screen shot of the current screen and also we can save screen shot into device storage.
Usage:
navigator.screenshot.save(function(error,res){
if(error){
console.error(error);
}else{
console.log('Screen shot saved into your device.',res.filePath);
}
});
In the above example navigator.screenshot.save method take screen shot of screen and save it to the mobile storage.
For more details visit: screen shot plugin for cordova / phonegap application
Hope this will help you :)
0 Comment(s)