Saiprasad_Boinkar wrote:

This is Sai Prasad from hyderabad,india. It is regarding error when creating an image using the JPEG Encoder classes : Iam getting java.lang.IllegalArgumentException: NumComponents not in sync with COLOR_ID . The code is working fine in windows98/2000 .Iam facing this problem when i move my code from windows98 to solaris.Can u suggest some solution to get rid of this problem.

Well this isn't really a Batik question (this is a Java2D question). The first set of code should work, assuming that bImg is the image that you end up writing to 'jpeg'.

   I suspect the root of the problem is that bImg is an image
with an Alpha channel.  You might try using:

BufferedImage bImg = new BufferedImage(600,600,BufferedImage.TYPE_INT_RGB);
chart.paint(bImg.createGraphics());
[...]


So your base is an image w/o Alpha.

Or you could try using (from the second set of code):


JPEGCodec.getDefaultJPEGEncodeParam(bImg.getSampleModel().getNumBands(), com.sun.image.codec.jpeg.JPEGDecodeParam.COLOR_ID_YCbCrA);




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to