Class ImageFileWriter

java.lang.Object
org.fest.swing.image.ImageFileWriter

public class ImageFileWriter extends Object
Understands how to write an image as a file in the file system.
  • Constructor Details

    • ImageFileWriter

      public ImageFileWriter()
  • Method Details

    • writeAsPng

      public boolean writeAsPng(BufferedImage image, String filePath) throws IOException
      Writes an image as a PNG file to the file system. If there is already a File present, its contents are discarded.
      Parameters:
      image - a BufferedImage to be written.
      filePath - the path of the image file to create.
      Returns:
      false if the image could not be saved.
      Throws:
      IOException - if an error occurs during writing.