SnapShot of an Onscreen Canvas

Hi,

I want to take a snapShot of an OnScreen Canvas and write it onto an image file. I could get access only to the Graphics Context of the Canvas (using getGraphics()). How do you get access to the pixel information from the Graphics Context. Could somebody help me?

Many Thanks

[305 byte] By [somasund] at [2007-9-26 2:33:00]
# 1
If you can getGraphics can you get the BufferedImage. If so you can save this as a JPEG (nb Sun have hidden the JPEG classes away).MArk
markee1 at 2007-6-29 9:55:26 > top of Java-index,Archived Forums,Java Programming...
# 2

That is the problem. How do I get an Image or a BufferedImage from the graphics context which is on screen. Only if I get an image will be able to write it as a jpeg.

> If you can getGraphics can you get the BufferedImage.

> If so you can save this as a JPEG (nb Sun have hidden

> the JPEG classes away).

>

> MArk

somasund at 2007-6-29 9:55:26 > top of Java-index,Archived Forums,Java Programming...