public class PNGSaver extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte |
BW_MODE
black and white image mode.
|
static byte |
COLOR_MODE
full color image mode.
|
static byte |
GREYSCALE_MODE
grey scale image mode.
|
| Constructor and Description |
|---|
PNGSaver(File file) |
PNGSaver(OutputStream out)
public constructor of PNGEncoder class with greyscale mode by default.
|
PNGSaver(OutputStream out,
byte mode)
public constructor of PNGEncoder class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(Raster image)
main encoding method (stays blocked till encoding is finished).
|
public static final byte BW_MODE
public static final byte GREYSCALE_MODE
public static final byte COLOR_MODE
public PNGSaver(File file) throws FileNotFoundException
FileNotFoundExceptionpublic PNGSaver(OutputStream out)
out - output stream for PNG image format to write intopublic PNGSaver(OutputStream out, byte mode)
out - output stream for PNG image format to write intomode - BW_MODE, GREYSCALE_MODE or COLOR_MODEpublic void encode(Raster image) throws IOException
image - BufferedImage to encodeIOException - IOExceptionCopyright © 2018. All rights reserved.