Adjusting the way JViews Charts writes out JPEG files

Article ID: 2314
Last updated: 01 Dec, 2014
Article ID: 2314
Last updated: 01 Dec, 2014
Revision: 1
Views: 837
Posted: 18 Jun, 2010
by Dean J.
Updated: 01 Dec, 2014
by Garnier T.

Question

How can I adjust the way JViews Charts writes out JPEG files?

Answer

By default, the JPEG image created by the IlvChart.toJPEG()function is done with very high quality and very little compression.

To control the JPEG settings, you should instead use the IlvChart.toImage function to create a BufferedImage, then convert the BufferedImage to JPEG yourself, using whatever parameters and tools are desired.

For instance, you could use the classes in the com.sun.image.codec.jpeg or the javax.imageio packages to create an encoder/writer, specify JPEG parameters (including quality), and write the image data to the appropriate stream or file as needed.

If you are concerned about file size, you may wish to test how the PNG format (the code>IlvChart.toPNG() methods) compares to chart data.

missing link to : http://pic.dhe.ibm.com/infocenter/jviewent/v8r8/index.jsp?topic=%2Fcom.ibm.ilog.jviews.charts.doc%2Fhtml%2Frefjava%2Fhtml%2Filog%2Fviews%2Fchart%2FIlvChart.html

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2314
Last updated: 01 Dec, 2014
Revision: 1
Views: 837
Posted: 18 Jun, 2010 by Dean J.
Updated: 01 Dec, 2014 by Garnier T.
Also listed in


Others in this category