Thursday, March 19, 2009

How do I write a BufferedImage to an output stream?

The ImageIO class provides utility classes for both read and writing images. To write your image to an output stream you would can use the write method telling it what format you want to write the image in, eg. JPEG, PNG.


ImageIO.write(image, "PNG", out);

No comments: