Java BufferedImage to PNG bufferedImageToFile(BufferedImage src, String path)

Here you can find the source of bufferedImageToFile(BufferedImage src, String path)

Description

buffered Image To File

License

Open Source License

Declaration

public static boolean bufferedImageToFile(BufferedImage src, String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.image.BufferedImage;

import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Main {
    public static boolean bufferedImageToFile(BufferedImage src, String path) {
        try {//w  w  w .ja  va  2  s.  c o m
            File outputFile = new File(path);
            ImageIO.write(src, "png", outputFile);
            return true;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return false;
    }
}

Related

  1. imageAsBase64Png(Component c)
  2. imageToPNG(BufferedImage image)
  3. imageToPngFile(BufferedImage image, File pngFile)
  4. image(BufferedImage image)