public class Images
extends java.lang.Object
| Constructor and Description |
|---|
Images() |
| Modifier and Type | Method and Description |
|---|---|
static Image |
encode(java.lang.String name,
java.awt.image.RenderedImage image)
Encodes an AWT image into a ZK image.
|
static Image |
encode(java.lang.String name,
java.awt.image.RenderedImage image,
float quality,
boolean encodeAlpha)
Encodes an AWT image into a ZK image (in PNG, JPEG or other format).
|
public static Image encode(java.lang.String name, java.awt.image.RenderedImage image, float quality, boolean encodeAlpha) throws java.io.IOException
name - The name of the image. The extension of the name must
be the format. Supported format: png and jpeg.
For example, foo.png and foo.jpeg.image - The AWT image to be encoded.quality - The quality to use for the image encoding.
It is a number between 0 and 1. The higher the value,
the better the output quality.
Not applicable to "png".encodeAlpha - Whether to encode alpha transparency.
Not applicable to "png".java.lang.IllegalArgumentException - if name doesn't contain an
extension with supported format.java.io.IOExceptionpublic static Image encode(java.lang.String name, java.awt.image.RenderedImage image) throws java.io.IOException
name - The name of the image. The extension of the name must
be the format. For example, foo.png and foo.jpeg.image - The AWT image to be encoded.java.lang.IllegalArgumentException - if name doesn't contain an
extension with supported format.java.io.IOExceptionCopyright © 2005-2011 Potix Corporation. All Rights Reserved.