save PNG Image - Java 2D Graphics

Java examples for 2D Graphics:PNG

Description

save PNG Image

Demo Code


//package com.java2s;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Main {
    public static void savePNGImage(BufferedImage image,
            String pathWithoutExtension) throws IOException {
        ImageIO.write(image, "png", new File(pathWithoutExtension + ".png"));
    }/*w  w  w  .j  a v a 2 s.  c  o m*/
}

Related Tutorials