Thanks for answering, even late. Interestingly, your post was the most helpful 
of any other responses I received on this subject, even though you didn't offer 
any specific example code. In this case the basic concepts were more important.

I had to do some pretty low-level debugging to get this to work. I created a 
BufferedImage in Java, painted my Icon into it, and output the pixel Raster as 
a grid of hex values, and then got all the meta data I could from that image. 
Then I did the same for the same image file, opened from a Cocoa app. I was 
eventually able to figure out what all the parameter values should be by 
comparing the two Rasters and metadata in memory.

I had to use a "weird" BufferedImage type of TYPE_3BYTE_BGR, then swap the B & 
R bytes from the Raster since the Cocoa libraries wants them in RGB. I couldn't 
get TYPE_INT_ARGB to work. I don't think Cocoa can deal with the alpha values 
in the same Raster, but I was tired of debugging this problem so I haven't 
followed up on that. For now I can pass Icon images to Cocoa via JNI and create 
a native NSBitmapImageRep, so I am somewhat relieved that this finally works.

Again, thank you for the help.

Rob Ross
[Message sent by forum member 'robross' (robross)]

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

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