Package org.zkoss.image.encoder
Class PNGEncoder
- java.lang.Object
-
- org.zkoss.image.encoder.PNGEncoder
-
- All Implemented Interfaces:
ImageEncoder
public class PNGEncoder extends java.lang.Object implements ImageEncoder
The encoder for encoding an image into the PNG format- Since:
- 3.0.7
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description PNGEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
encode(java.awt.image.RenderedImage image)
Encodes an AWT image into a byte array in a particular format.float
getQuality()
Always return 1.0 since no quality degrade.boolean
isEncodingAlpha()
Returns whether to encode the alpha transparency.void
setEncodingAlpha(boolean encodeAlpha)
Sets whether to encode the alpha transparency.void
setQuality(float quality)
Sets the quality of the image encoding.
-
-
-
Method Detail
-
encode
public byte[] encode(java.awt.image.RenderedImage image) throws java.io.IOException
Description copied from interface:ImageEncoder
Encodes an AWT image into a byte array in a particular format.- Specified by:
encode
in interfaceImageEncoder
- Throws:
java.io.IOException
-
getQuality
public float getQuality()
Always return 1.0 since no quality degrade.- Specified by:
getQuality
in interfaceImageEncoder
-
setQuality
public void setQuality(float quality)
Description copied from interface:ImageEncoder
Sets the quality of the image encoding. Simply does nothing if the encoder does not support it.- Specified by:
setQuality
in interfaceImageEncoder
-
isEncodingAlpha
public boolean isEncodingAlpha()
Description copied from interface:ImageEncoder
Returns whether to encode the alpha transparency.- Specified by:
isEncodingAlpha
in interfaceImageEncoder
-
setEncodingAlpha
public void setEncodingAlpha(boolean encodeAlpha)
Description copied from interface:ImageEncoder
Sets whether to encode the alpha transparency. Simply does nothing if the encoder does not support it.- Specified by:
setEncodingAlpha
in interfaceImageEncoder
-
-