Can we create transparent jpg's using the com.sun.image.codec.jpeg package?

I have some .jpg files created from xpm files (using a C++ tool) that are
transparent AND they show up correctly (ie transparent where appropriate)
when textured on QuadArrays in our Java3D app.

We have used the image package to create .jpg's without alpha using the
BufferedImage approach but cannot get a JPEGEncodeParam object created from
a Raster if we use alpha.

Here is a code fragment:

> > BufferedImage bi = new
> > BufferedImage(width,height,BUFFEREDIMAGE.TYPE_4BYTE_ABGR);
> > ColorModel cm = bi.getColorModel();
> > Raster ra = bi.getAlphaRaster();
> > //fill raster in a loop
> > ra.setPixel(x,y,abgr); //where abgr is a 4 byte array
> > //Create encoder
> > BufferedOutputStream bos = new BufferedOutputStream(fos);
> > JPEGImageEncoder jie = JPEGCodec.createJPEGEncoder(bos);
> > //Create param object using raster and color_id
> > int cid = jie.getDefaultColorId(cm);
> > JPEGEncodeParam jep = new JPEGEncodeParam(ra,cid);

Any help is appreciated..

Gregg,

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to