I have a VolatileImage and I would like to take a snapshot of a region of it and then restore this region at a later time. I cannot quite figure out how to do it.
So far, I have established that I need to firstly get the snapshot using the image.getSnapshot() method which creates a BufferedImage of the entire volatile image. Then it would seem I need to use the copy the bufferedImage.copyData() method to copy the region I want but that method requires a Raster. So first I have to create Raster. To do this I think I should use the Raster.createWritableRaster() method which requires a SampleModel and a Point. To create the SampleModel it looks like I should be using a SinglePixelPackedSampleModel. To create the SinglePixelPackedSampleModel I need to specify an array of bit masks. What do I need to put into this bit mask array? Or, is there a simple way of doing this? It seems rather complicated! Perhaps someone has an example of this kind of thing? -- And loving it, -Q _________________________________________________ [EMAIL PROTECTED] (Replace the "SixFour" with numbers to email me) [Message sent by forum member 'qu0ll' (qu0ll)] http://forums.java.net/jive/thread.jspa?messageID=246312 =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
