Is there a way to take a screenshot using Java and save it to some sort of image? -


simple title states: can use java commands take screenshot , save it? or, need use os specific program take screenshot , grab off clipboard?

believe or not, can use java.awt.robot "create image containing pixels read screen." can write image file on disk.

i tried it, , whole thing ends like:

rectangle screenrect = new rectangle(toolkit.getdefaulttoolkit().getscreensize()); bufferedimage capture = new robot().createscreencapture(screenrect); imageio.write(capture, "bmp", new file(args[0])); 

note: capture primary monitor. see graphicsconfiguration multi-monitor support.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -