| | | | Browse by category |
Question
How can I dump an IlvManager as an image file?
Answer
Dumping an IlvManager
in an image file can be split in two steps:
- draw the
IlvManager
in a specificjava.awt.Graphics
object. This specificGraphics
object being in fact theGraphics
of ajava.awt.Image
object. - Encode the image in a given file format. Encoding an image is the process of coding the binary representation of an image (also known as an
Image
object) into an image file in a given format, for example a JPEG file. Such encoders are not part of the Java 1.2 specifications, and generally you need to get one from a tier library (except for the Sun JDK 1.2 that provides a JPEG encoder).
For example: to dump an IlvManager
using Java 2 v1.2 in a JPEG file, you can use the Sun JPEG encoder provided with the JDK. This sample application shows how this JPEG enconding can be implemented; download it here: IlvJPEGEncoder30.java
Note: In order to run this sample with JViews 8.7 and later, you must call the log.views.util.IlvProductUtil.DeploymentLicenseRequired
method with the appropriate argument. See the General information > Deployment licenses > Declaring the use of Rogue Wave JViews services
section in the documentation for more information.
Note: If you use a particular coordinate system, you can transform the view region by implementing a method such as computeCoordinates(Point) in class App6aDemo.java of the app6a sample provided in JViews Maps for Defense distribution.