"Mike Owens" <firstname.lastname@example.org> wrote in message
>I have an SWT canvas that I can save without any problems to BMP and Jpeg.
>Is it possible to save it as a GIF?
> Or, does anyone have a code example that will convert an SWT Image to
> transparent GIF? Thanks!
> Mike O.
I just figured this out with some trial and error. In case anyone else
is interested, this is how I took an SWT image from a canvas and turned
it into a PNG with alpha transparency:
Convert the SWT image to AWT (found a code snippet online)
Get the pixels from the AWT image
If the pixel is white (or whatever color you want to be transparent)
perform a 0x00 >> pixel, else do pixel << 0x00 to store in a new one
Use AWT Component's createImage function get a new AWT image
Save the AWT using Jimi with the PNGEncoder