public class ImageIOUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_COMPRESSION_QUALITY
Default compression quality: 1.0f.
|
static int |
DEFAULT_SCREEN_RESOLUTION
Default screen resolution: 72dpi.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
writeImage(BufferedImage image,
String imageFormat,
Object outputStream,
int resolution)
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(BufferedImage image,
String imageFormat,
Object outputStream,
int resolution,
float quality)
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(BufferedImage image,
String imageFormat,
OutputStream outputStream)
Writes a buffered image to a file using the given image format.
|
static boolean |
writeImage(BufferedImage image,
String imageFormat,
String filename,
int imageType,
int resolution)
Writes a buffered image to a file using the given image format.
|
public static final int DEFAULT_SCREEN_RESOLUTION
public static final float DEFAULT_COMPRESSION_QUALITY
public static boolean writeImage(BufferedImage image, String imageFormat, String filename, int imageType, int resolution) throws IOException
image - the image to be writtenimageFormat - the target format (ex. "png")filename - used to construct the filename for the individual imagesimageType - the image type (see BufferedImage.TYPE_*)resolution - the resolution in dpi (dots per inch)IOException - if an I/O error occurspublic static boolean writeImage(BufferedImage image, String imageFormat, OutputStream outputStream) throws IOException
image - the image to be writtenimageFormat - the target format (ex. "png")outputStream - the output stream to be used for writingIOException - if an I/O error occurspublic static boolean writeImage(BufferedImage image, String imageFormat, Object outputStream, int resolution) throws IOException
image - the image to be writtenimageFormat - the target format (ex. "png")outputStream - the output stream to be used for writingresolution - resolution to be used when writing the imageIOException - if an I/O error occurspublic static boolean writeImage(BufferedImage image, String imageFormat, Object outputStream, int resolution, float quality) throws IOException
image - the image to be writtenimageFormat - the target format (ex. "png")outputStream - the output stream to be used for writingresolution - resolution to be used when writing the imagequality - quality to be used when compressing the image (0 < quality < 1.0f)IOException - if an I/O error occursCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.