Class ImageWriterUtil
java.lang.Object
org.apache.xmlgraphics.image.writer.ImageWriterUtil
Convenience methods around ImageWriter for the most important tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsaveAsFile(RenderedImage bitmap, int resolution, File outputFile, String mime) Saves a RenderedImage as a file.static voidsaveAsPNG(RenderedImage bitmap, int resolution, File outputFile) Saves a RenderedImage as a PNG file.static voidsaveAsPNG(RenderedImage bitmap, File outputFile) Saves a RenderedImage as a PNG file with 96 dpi.
-
Constructor Details
-
ImageWriterUtil
private ImageWriterUtil()
-
-
Method Details
-
saveAsPNG
Saves a RenderedImage as a PNG file with 96 dpi.- Parameters:
bitmap- the bitmap to encodeoutputFile- the target file- Throws:
IOException- in case of an I/O problem
-
saveAsPNG
public static void saveAsPNG(RenderedImage bitmap, int resolution, File outputFile) throws IOException Saves a RenderedImage as a PNG file.- Parameters:
bitmap- the bitmap to encoderesolution- the bitmap resolutionoutputFile- the target file- Throws:
IOException- in case of an I/O problem
-
saveAsFile
public static void saveAsFile(RenderedImage bitmap, int resolution, File outputFile, String mime) throws IOException Saves a RenderedImage as a file. The image format is given through the MIME type- Parameters:
bitmap- the bitmap to encoderesolution- the bitmap resolutionoutputFile- the target filemime- the MIME type of the target file- Throws:
IOException- in case of an I/O problem
-