Adding support for custom image formats
The generation of the image in a specific format is performed by means of the image
encoders. The
IlvChartServletSupport class defines the image encoder objects through the
IlvImageEncoder interface. This interface defines the behavior of a class that can encode an image onto an
HttpServletResponse. To generate JPEG and PNG images the JViews Charts library provides two implementations of the
IlvImageEncoder interface: the
IlvJPEGEncoder and
IlvPNGEncoder classes.
To add support for another image format, follow these steps:
1. Write a new implementation of the IlvImageEncoder interface that encodes an image in the given output format.
2. Register it on the
IlvChartServletSupport class so that the new format can be recognized as a supported format. Registering a new image encoder is done by means of the following method:
setImageEncoder.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.