Simple wrapper screen image capture with toolbar
npm install imagecapThis package is for electron windows
Install:
==
``shell
`
npm install imagecap
`
Electron:
==
You must disabled webSecurity when create browser window
--
Javascript
`
webPreferences: {
webSecurity: false,
}
`
Sample.html:
--
html
`
ImageCap plugin for Electron
`
Sample code of javascript
--
javascript
``
const img = document.getElementById( 'img-screencap' );
const btn = document.getElementById( 'btn-screencap' );
btn.onclick = ()=> {
const imagecap = require('imagecap');
imagecap.screencapture( function( e, errorurl ) {
if( e ) {
// Show error message
console.log( errorurl );
} else {
// Show image
img.src = url;
}
});