public class ImageIOUtil
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static float |
DEFAULT_COMPRESSION_QUALITY |
Default compression quality: 1.0f.
|
static int |
DEFAULT_SCREEN_RESOLUTION |
Default screen resolution: 72dpi.
|
Modifier and Type | Method | Description |
---|---|---|
static boolean |
writeImage(java.awt.image.BufferedImage image,
java.lang.String filename,
int dpi) |
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(java.awt.image.BufferedImage image,
java.lang.String formatName,
java.io.OutputStream output) |
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(java.awt.image.BufferedImage image,
java.lang.String formatName,
java.io.OutputStream output,
int dpi) |
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(java.awt.image.BufferedImage image,
java.lang.String formatName,
java.io.OutputStream output,
int dpi,
float quality) |
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(java.awt.image.BufferedImage image,
java.lang.String formatName,
java.lang.String filename,
int dpi) |
Deprecated.
use
writeImage(BufferedImage image, String filename, int dpi) , which
uses the full filename instead of just the prefix. |
public static final int DEFAULT_SCREEN_RESOLUTION
public static final float DEFAULT_COMPRESSION_QUALITY
public static boolean writeImage(java.awt.image.BufferedImage image, java.lang.String filename, int dpi) throws java.io.IOException
writeImage(BufferedImage image, String formatName,
OutputStream output, int dpi, float quality)
for more details.image
- the image to be writtenfilename
- used to construct the filename for the individual image.
Its suffix will be used as the image format.dpi
- the resolution in dpi (dots per inch)java.io.IOException
- if an I/O error occurs@Deprecated public static boolean writeImage(java.awt.image.BufferedImage image, java.lang.String formatName, java.lang.String filename, int dpi) throws java.io.IOException
writeImage(BufferedImage image, String filename, int dpi)
, which
uses the full filename instead of just the prefix.writeImage(BufferedImage image, String formatName,
OutputStream output, int dpi, float quality)
for more details.image
- the image to be writtenformatName
- the target format (ex. "png") which is also the suffix
for the filenamefilename
- used to construct the filename for the individual image.
The formatName parameter will be used as the suffix.dpi
- the resolution in dpi (dots per inch)java.io.IOException
- if an I/O error occurspublic static boolean writeImage(java.awt.image.BufferedImage image, java.lang.String formatName, java.io.OutputStream output) throws java.io.IOException
writeImage(BufferedImage image, String formatName,
OutputStream output, int dpi, float quality)
for more details.image
- the image to be writtenformatName
- the target format (ex. "png")output
- the output stream to be used for writingjava.io.IOException
- if an I/O error occurspublic static boolean writeImage(java.awt.image.BufferedImage image, java.lang.String formatName, java.io.OutputStream output, int dpi) throws java.io.IOException
writeImage(BufferedImage image, String formatName,
OutputStream output, int dpi, float quality)
for more details.image
- the image to be writtenformatName
- the target format (ex. "png")output
- the output stream to be used for writingdpi
- resolution to be used when writing the imagejava.io.IOException
- if an I/O error occurspublic static boolean writeImage(java.awt.image.BufferedImage image, java.lang.String formatName, java.io.OutputStream output, int dpi, float quality) throws java.io.IOException
image
- the image to be writtenformatName
- the target format (ex. "png")output
- the output stream to be used for writingdpi
- resolution to be used when writing the imagequality
- quality to be used when compressing the image (0 <
quality < 1.0f)java.io.IOException
- if an I/O error occurs