public class PngEncoder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BEST_COMPRESSION |
static int |
BEST_SPEED |
static int |
COLOR_INDEXED |
static int |
COLOR_TRUECOLOR |
static int |
COLOR_TRUECOLOR_ALPHA |
static int |
DEFAULT_COMPRESSION |
| Constructor and Description |
|---|
PngEncoder()
Creates a new PNG encoder using the default compression and the true color type.
|
PngEncoder(int colorType,
int compression)
Creates a new PNG encoder using the specified compression and color type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(java.awt.Image image,
java.io.OutputStream os)
Encodes the specified image to the specified output stream.
|
public static final int DEFAULT_COMPRESSION
public static final int BEST_COMPRESSION
public static final int BEST_SPEED
public static final int COLOR_TRUECOLOR_ALPHA
public static final int COLOR_TRUECOLOR
public static final int COLOR_INDEXED
public PngEncoder()
public PngEncoder(int colorType,
int compression)
colorType - the color type to encode with.compression - the compression level.public void encode(java.awt.Image image,
java.io.OutputStream os)
throws java.io.IOException
image - the image to encode.os - the output stream which will receive the encoded image.java.io.IOException