Skip to content

Commit

Permalink
Export captureScreen to Node.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Oct 6, 2015
1 parent ec4f953 commit 5dc3557
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
module.exports = require('./build/Release/robotjs.node');
var robotjs = require('./build/Release/robotjs.node');

module.exports = robotjs;

module.exports.screen = {};

function bitmap (width, height, byteWidth, bitsPerPixel, bytesPerPixel, image)
{
this.width = width;
this.height = height;
this.byteWidth = byteWidth;
this.bitsPerPixel = bitsPerPixel;
this.bytesPerPixel = bytesPerPixel;
this.image = image;
}

module.exports.screen.capture = function()
{
b = robotjs.captureScreen();
return new bitmap(b.width, b.height, b.byteWidth, b.bitsPerPixel, b.bytesPerPixel, b.image);
};

0 comments on commit 5dc3557

Please sign in to comment.