-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow resolution adaption of the captured screen #569
Conversation
BufferedImage screen = robot.createScreenCapture(bounds); | ||
int width = resolution.width; | ||
int height = resolution.height; | ||
BufferedImage img = new BufferedImage(width, height, screen.getType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider checking if screen image from Robot has the same size as resolution Dimension and return original screen image in such a case, so we do not need to create resized image when it's unnecessary.
if (screen.getWidth() == width && screen.getHeight() == height) {
return screen;
}
Hi @gubjack, thank you for this PR :) This is really nice functionality. I added one comment in regards to the changes you made. |
You’re welcome!
I’ll take care the next days. To much other work …
Hagen
… Am 25.10.2017 um 09:40 schrieb Bartosz Firyn ***@***.***>:
Hi @gubjack <https://github.com/gubjack>, thank you for this PR :) This is really nice functionality. I added one comment in regards to the changes you made.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#569 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ASZ8FgZfVd8ponBrO_R4Cp5zdcAtrMDIks5svuXwgaJpZM4QFd_w>.
|
Sure. I can merge this now and add mentioned fix later if you like. |
…esired resolution
Thank you @gubjack! I'm merging this. |
👌 |
It might be useful the adapt the resolution of a captured screen as one would be able with a normal camera.