I'm trying out an idea I had which requires me to capture the contents of a java window/Frame, much like a screenshot but without the window and menubar, just the contents rendered in java, i.e. an exact image of what is visible in the java application at the moment.

I would also like the screenshot to be software rendered, I don't know if I'm using the correct term, but the captured image should not be different on others systems/computers.

Can i for example hijack a render buffer/display buffer or something and write that to in image?

Does anyone have any ideas?



Try this..Robot

Robot r=new Robot();
r.createScreenCapture(new Rectangle(your jframe co-ordinates as parameters));

You need to calculate the co-ordinates of your frame inorder to capture only the frame.

If you want to write the captured image to a image file , you can use ImageIO.write() method

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.