Skip to content

Commit 5dc3557

Browse files
committed
Export captureScreen to Node.js.
1 parent ec4f953 commit 5dc3557

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

index.js

+21-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
module.exports = require('./build/Release/robotjs.node');
1+
var robotjs = require('./build/Release/robotjs.node');
2+
3+
module.exports = robotjs;
4+
5+
module.exports.screen = {};
6+
7+
function bitmap (width, height, byteWidth, bitsPerPixel, bytesPerPixel, image)
8+
{
9+
this.width = width;
10+
this.height = height;
11+
this.byteWidth = byteWidth;
12+
this.bitsPerPixel = bitsPerPixel;
13+
this.bytesPerPixel = bytesPerPixel;
14+
this.image = image;
15+
}
16+
17+
module.exports.screen.capture = function()
18+
{
19+
b = robotjs.captureScreen();
20+
return new bitmap(b.width, b.height, b.byteWidth, b.bitsPerPixel, b.bytesPerPixel, b.image);
21+
};

0 commit comments

Comments
 (0)