-
Notifications
You must be signed in to change notification settings - Fork 975
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
Implement Screen Capture #152
Conversation
Catch up the bitmap2 branch.
This should fix the issue on Windows and Linux.
Merge changes from master.
Just remembered that I wanted to update the Appveyor and TravisCI config to include newer versions of Node.js, and allow 0.8.x to fail. Here's what I came up with: https://gist.github.com/octalmage/326fffd925f8e517a961 Might be overkill, I'll work on getting this in tomorrow. |
@octalmage So I tried writing the data as a Bitmap file. Unfortunately this is taking a lot of space. Since I had to write as raw bytes I got some 8Mb for a screen of size 1920x1080. But the same only takes about 1Mb when I do a printscreen and paste it in Paint. So we may have to do some compression before storing it to the file system. |
Did you see my bitmap-save branch? Bitmaps are larger in general, I'm sure that saving to a png will be much better. I did a ton of benchmarking and after taking a full screen capture, Node.js used around 4mb. |
@octalmage I will take a look into it. PNG has advantages but do we not need external libraries to convert it to PNG ? |
@Deltatiger we'll need to include libpng for Windows, but it shouldn't be that difficult. Just need to figure out how to link the library with node-gyp. I'm sure someone has done it! |
@Deltatiger alright this is ready! The tests are running now and they should all pass. How does this look to you? |
@octalmage Honestly speaking I am not that experienced with TravisCI or Appveyor. Just starting to learn those. If this looks good to you, go ahead. I am not that experienced just yet. |
@Deltatiger Thanks! I was mostly worried about the screen capture code. I'm going to merge it! |
robot.screen.capture() will not capture the full screen on windows 4k monitor. Setting RobotJs.screen.capture(0, 0, 3840, 2160) fixes |
Overview
This is the first piece of the "bitmap" related functionality. In its current state, it allows you to read the screen much quicker than getPixelColor. The next priority is to allow you to save a screen capture to a file. This PR breaks compatibility with Node.js 0.8.x, if anyone has an issue with this speak up now!
Special thanks to @Deltatiger for solving a critical issue, and @demipixel for testing.
Usage
Reviewers
TODO
Related
#13
#4 - This is the start of the new function naming convention.