public class PngEncoder extends Object
PngEncoder encoder = new PngEncoder();
encoder.write(image, outputStream);
PngEncoder encoder = new PngEncoder();
encoder.setCompressed(true);
encoder.write(image, outputStream);
| 构造器和说明 |
|---|
PngEncoder() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
isCompressed()
Returns whether 8 bit quantisation compression is enabled
|
void |
setCompressed(boolean compress)
Set true to enable 8 bit quantisation compression in png generation
|
void |
write(BufferedImage image,
OutputStream outputStream)
Writes BufferedImage as Png to OutputStream
This method does not close the provided OutputStream after the write
operation has completed; it is the responsibility of the caller to close
the stream.
|
public void write(BufferedImage image, OutputStream outputStream) throws IOException
This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream.
image - BufferedImage The image to writeoutputStream - The stream to write the image toIOException - if the image wasn't writtenpublic boolean isCompressed()
public void setCompressed(boolean compress)
compress - If compression should be enabledCopyright © 2021. All rights reserved.