win_imagesnap
v0.0.2
Published
Windows NT Imagesnap Library. (Capture Webcam and Screenshot Image)
Downloads
3
Readme
win_imagesnap
Windows NT Imagesnap Library for Node.js. (Get binary image data from Webcam and Screenshot)
API
var imagesnap = require('./win_imagesnap');
// arguments. (quality, function(err,data){})
// quality : image quality (0 ~ 100).
// data is base64 encoded string.
imagesnap.getScreenshotImage(24, function (err,data) {
if(!err) {
var decodedImage = new Buffer(data,'base64');
fs.writeFile('screenshot.jpg', decodedImage, function(err) {});
} else {
console.log("Failed to capture screenshot image.");
}
});
// arguments. (quality, function(err,data){}). data is base64 encoded string.
// quality : image quality (0 ~ 100).
// data is base64 encoded string.
imagesnap.getWebcamImage(24, function (err,data) {
if(!err) {
var decodedImage = new Buffer(data,'base64');
fs.writeFile('webcam.jpg', decodedImage, function(err) {});
} else {
console.log("Failed to capture screenshot image.");
}
});