Package org.zkoss.image.encoder
Class PNGEncoder
java.lang.Object
org.zkoss.image.encoder.PNGEncoder
- All Implemented Interfaces:
ImageEncoder
The encoder for encoding an image into the PNG format
- Since:
- 3.0.7
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode(RenderedImage image) Encodes an AWT image into a byte array in a particular format.floatAlways return 1.0 since no quality degrade.booleanReturns whether to encode the alpha transparency.voidsetEncodingAlpha(boolean encodeAlpha) Sets whether to encode the alpha transparency.voidsetQuality(float quality) Sets the quality of the image encoding.
-
Constructor Details
-
PNGEncoder
public PNGEncoder()
-
-
Method Details
-
encode
Description copied from interface:ImageEncoderEncodes an AWT image into a byte array in a particular format.- Specified by:
encodein interfaceImageEncoder- Throws:
IOException
-
getQuality
public float getQuality()Always return 1.0 since no quality degrade.- Specified by:
getQualityin interfaceImageEncoder
-
setQuality
public void setQuality(float quality) Description copied from interface:ImageEncoderSets the quality of the image encoding. Simply does nothing if the encoder does not support it.- Specified by:
setQualityin interfaceImageEncoder
-
isEncodingAlpha
public boolean isEncodingAlpha()Description copied from interface:ImageEncoderReturns whether to encode the alpha transparency.- Specified by:
isEncodingAlphain interfaceImageEncoder
-
setEncodingAlpha
public void setEncodingAlpha(boolean encodeAlpha) Description copied from interface:ImageEncoderSets whether to encode the alpha transparency. Simply does nothing if the encoder does not support it.- Specified by:
setEncodingAlphain interfaceImageEncoder
-