Read pixels that have been painted on a Canvas?



I've been painting on a Canvas using the Graphics object returned by
getGraphics(). I would like to save an area on the Canvas and later write
it back to the Canvas. I've been looking for some way to create a
BufferedImage using the pixels from a Graphics object, but no luck.

How do I obtain the pixels from an area on a Canvas?

Thanks,
Cameron


.



Relevant Pages