The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » Java 2D

Thread: Creating a VolatileImage from a WritableRaster?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 4 - Last Post: Nov 11, 2008 10:37 AM by: qu0ll Threads: [ Previous | Next ]
qu0ll

Posts: 306
Creating a VolatileImage from a WritableRaster?
Posted: Nov 10, 2008 5:12 PM
 
  Click to reply to this thread Reply

Is there a way to construct a volatile image from a writable raster? How?

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

trembovetski

Posts: 644
Re: Creating a VolatileImage from a WritableRaster?
Posted: Nov 10, 2008 9:46 PM   in response to: qu0ll
 
  Click to reply to this thread Reply

Create a BufferedImage from that raster, and copy it to a VolatileImage of appropriate size. You'll have to update the image every time the raster changes though.

It may be better just using the BufferedImage - although that depends on what you're trying to do.

Dmitri

qu0ll

Posts: 306
Re: Creating a VolatileImage from a WritableRaster?
Posted: Nov 10, 2008 9:55 PM   in response to: trembovetski
 
  Click to reply to this thread Reply

Hi Dmitri,

Thanks for the tip, but how do I copy a BufferedImage into a VolatileImage?

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

linuxhippy

Posts: 646
Re: Creating a VolatileImage from a WritableRaster?
Posted: Nov 11, 2008 8:38 AM   in response to: qu0ll
 
  Click to reply to this thread Reply

volatileImg.getGraphics().drawImage(buffImg....) ;)

qu0ll

Posts: 306
Re: Creating a VolatileImage from a WritableRaster?
Posted: Nov 11, 2008 10:37 AM   in response to: linuxhippy
 
  Click to reply to this thread Reply

Ah yes thanks, sorry about the dopey question.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]




 XML java.net RSS