Skip to main content

converting Java Image to Mac OS native image

1 reply [Last post]
Anonymous

Hi. Long shot here, but having no luck finding sample code...

I'm writing some JNI code that will run on Mac OS X. I need to call a
native method and pass it a Java image object, and be able to convert
that to a Mac OS X native image type, like an NSImage.

I'm pretty sure that the Java2D team knows how to do for Windows,
since it must happen at some point in your Java 2D Windows native/
implementation code.

Maybe I just need to be able to pass the Java image data as a byte[]
in some well-known byte structure that represents a JPEG or GIF, etc,
and I can convert it from there.

Any pointers?

Thanks,

Rob Ross, Lead Software Engineer
E! Networks
rross@eentertainment.com
---------------------------------------------------
"Beware of he who would deny you access to information, for in his
heart he dreams himself your master." -- Commissioner Pravin Lal

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Rob Ross

Let me try asking this question a different way.

Say I have an animated GIF file on my hard drive, and say I load that
aGIF into an java.awt.Image instance.

Now say I want to save that image back to a new, different file.

First, after I have saved it, will the bits in the new file be the
same as the original, ie, are they byte-for-byte copies?

If not that, can I at least open the new file in say a web-browser,
and see all the animated frames that were originally present in the
first file? (Is the integrity of the aGIF data still there?)

If so, then can you point me to some sample code where I can write
out the java.awt.Image to an OutputStream (ie, the same bytes that
would end up in the new file as mentioned above)? If I can get this
much, I can take it the rest of the way.

Thanks!

Rob Ross, Lead Software Engineer
E! Networks
rross@eentertainment.com
---------------------------------------------------
"Beware of he who would deny you access to information, for in his
heart he dreams himself your master." -- Commissioner Pravin Lal

On Sep 20, 2006, at 12:42 PM, Rob Ross wrote:

> Hi. Long shot here, but having no luck finding sample code...
>
> I'm writing some JNI code that will run on Mac OS X. I need to call a
> native method and pass it a Java image object, and be able to convert
> that to a Mac OS X native image type, like an NSImage.
>
> I'm pretty sure that the Java2D team knows how to do for Windows,
> since it must happen at some point in your Java 2D Windows native/
> implementation code.
>
> Maybe I just need to be able to pass the Java image data as a byte[]
> in some well-known byte structure that represents a JPEG or GIF, etc,
> and I can convert it from there.
>
> Any pointers?
>
> Thanks,
>
>
>
> Rob Ross, Lead Software Engineer
> E! Networks
> rross@eentertainment.com
> ---------------------------------------------------
> "Beware of he who would deny you access to information, for in his
> heart he dreams himself your master." -- Commissioner Pravin Lal
>
> ======================================================================
> =====
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body
> of the message "signoff JAVA2D-INTEREST". For general help, send
> email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".