Hi Mark

   You can try mixing the suggestion posted by Roman.
   Use GetRaster to set the underlying byte array of the image then create a 
new ByteBuffer wraper on the same array, that way u can navigate in the bytes 
of the image using the interfaces of the new I/O.

   Here are an example (modified) of how we populate the BufferedImage with the 
data come from PWLib, the 'raw' array are filled natively with JNI calls:

//we are using int arrays in the original code
//switched to byte array for use with nio.ByteBuffer, need align to 4byte (RBGX)
byte[] raw = new byte[frameWidth*frameHight*32];
ByteBuffer bb = ByteBuffer.wrap(raw);
BufferedImage bi = new BufferedImage(320, 240, TYPE_INT_BGR); //<-- important!
//Here how we are making the magic to send video data from PWLib to Java
getRaster().setDataElements(0, 0, frameWidth, frameHight, 
b.asIntBuffer().array());

Try evaluate this code and send to us the results ;)
[Message sent by forum member 'marcosfj' (marcosfj)]

http://forums.java.net/jive/thread.jspa?messageID=246518

===========================================================================
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".

Reply via email to