|
How to save a BufferedImage to a PNG file |
|
|
You can save a BufferedImage object using write method of the javax.imageio.ImageIO class. The signutaure of the method is like this:
public static boolean write(RenderedImage im,
String formatName,
File output)
throws IOException
|
Here im is the RenderedImage to be written, formatName is the String containg the informal name of the format (e.g. png) and output is the file object to be written to. An example usage of the method for PNG file format is shown below:
ImageIO.write(image, "png", file);
|
You can also use getReaderFormatNames method of the same class to learn available informal format names understood by the current set of registered readers.
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.