Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix screen capture for Mac. #242

Merged
merged 14 commits into from
Oct 16, 2016
Merged

Fix screen capture for Mac. #242

merged 14 commits into from
Oct 16, 2016

Conversation

octalmage
Copy link
Owner

Resolves #188.

For higher density screens (Macs), this PR means the resulting screen capture could be larger than the area requested. You can work around this by dividing the image size by the requested size. For example:

var size = 10;
var img = robot.screen.capture(0, 0, size, size);
// Support for higher density screens.
var multi = img.width / size;

var color = img.colorAt(2*multi, 3*multi);

This might be built into RobotJS at a later point.

@octalmage octalmage merged commit 3386cae into master Oct 16, 2016
@octalmage octalmage deleted the new-screenshot-code branch October 16, 2016 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant