1 Star 0 Fork 0

一条明/robotjs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.js 937 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jason Stallings 提交于 2016-10-15 18:25 . Remove .save.
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;
this.colorAt = function(x, y)
{
return robotjs.getColor(this, x, y);
};
}
module.exports.screen.capture = function(x, y, width, height)
{
//If coords have been passed, use them.
if (typeof x !== "undefined" && typeof y !== "undefined" && typeof width !== "undefined" && typeof height !== "undefined")
{
b = robotjs.captureScreen(x, y, width, height);
}
else
{
b = robotjs.captureScreen();
}
return new bitmap(b.width, b.height, b.byteWidth, b.bitsPerPixel, b.bytesPerPixel, b.image);
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yitiomin/robotjs.git
git@gitee.com:yitiomin/robotjs.git
yitiomin
robotjs
robotjs
master

搜索帮助