开发者

Java: API for Screen Capturing [duplicate]

开发者 https://www.devze.com 2023-02-20 23:55 出处:网络
This question already has answers here: Is there a way to take a screenshot using Java and save it to some sort of image?
This question already has answers here: Is there a way to take a screenshot using Java and save it to some sort of image? (8 answers) Closed 4 years ago.

Is there any API in java that takes to inputs as 2 coordinates and takes a snap sho开发者_StackOverflow中文版t of screen marked by that co-ordinates? I want to API to return IMAGE format.


Yes, there is java.awt.Robot.


Is there any API in java that takes to inputs as 2 coordinates and takes a snap shot of screen marked by that co-ordinates? ..

Use Robot.createScreenCapture(Rectangle).

..I want to API to return IMAGE format.

What is IMAGE format? ImageIO.write(RenderedImage, String, File) will write in GIF, JPEG & PNG formats. Further formats are offered by JAI.

0

精彩评论

暂无评论...
验证码 换一张
取 消