save JPEG Image - Java 2D Graphics

Java examples for 2D Graphics:JPEG

Description

save JPEG 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 saveJPEGImage(BufferedImage image,
            String pathWithoutExtension) throws IOException {
        ImageIO.write(image, "jpg", new File(pathWithoutExtension + ".jpg"));
    }/*from ww w.  j  a  v a  2 s. co  m*/
}

Related Tutorials