public interface IImageExporter
IImageExporter
object has methods for converting SVG source (String) to PNG or JPEG format and either return an InputStream
to read the image's bytes, or write the image bytes to a given OutputStream
.Modifier and Type | Method and Description |
---|---|
java.io.InputStream | getJPEG(java.lang.String svgString, java.lang.Float quality) Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created BufferedImage , and returns an InputStream for reading the BufferedImage in JPEG format at the given quality level. |
java.io.InputStream | getPNG(java.lang.String svgString) Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created BufferedImage , and returns an InputStream for reading the BufferedImage in PNG format. |
void | writeJPEG(java.io.OutputStream os, java.lang.String svgString, java.lang.Float quality) Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created BufferedImage , and writes the BufferedImage as a JPEG to os at the given quality level. |
void | writePNG(java.io.OutputStream os, java.lang.String svgString) Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created BufferedImage , and writes the BufferedImage as a PNG to os . |
void writePNG(java.io.OutputStream os, java.lang.String svgString) throws java.io.IOException
BufferedImage
, and writes the BufferedImage
as a PNG to os
.os
- the OutputStream
where the PNG data is written.svgString
- the SVG graphic source.java.io.IOException
void writeJPEG(java.io.OutputStream os, java.lang.String svgString, java.lang.Float quality) throws java.io.IOException
BufferedImage
, and writes the BufferedImage
as a JPEG to os
at the given quality level.os
- the OutputStream
where the JPEG data is written.svgString
- the SVG graphic source.quality
- a number between 0 and 1, with 1 representing the best quality and 0 representing the least quality but smallest file size. Pass null
to use the default quality.java.io.IOException
java.io.InputStream getPNG(java.lang.String svgString) throws java.io.IOException
BufferedImage
, and returns an InputStream
for reading the BufferedImage
in PNG format.svgString
- the SVG graphic source.InputStream
for reading a rasterization of the SVG graphic in PNG format.java.io.IOException
java.io.InputStream getJPEG(java.lang.String svgString, java.lang.Float quality) throws java.io.IOException
BufferedImage
, and returns an InputStream
for reading the BufferedImage
in JPEG format at the given quality level.svgString
- the SVG graphic source.quality
- a number between 0 and 1, with 1 representing the best quality and 0 representing the least quality but smallest file size. Pass null
to use the default quality.InputStream
for reading a rasterization of the SVG graphic in JPEG format.java.io.IOException