Package net.sf.jasperreports.engine.util
Class JRImageLoader
- java.lang.Object
-
- net.sf.jasperreports.engine.util.JRImageLoader
-
public final class JRImageLoader extends java.lang.Object
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CHART_IMAGE_RESOURCE
static java.lang.String
COMPONENT_IMAGE_RESOURCE
static java.lang.String
CROSSTAB_IMAGE_RESOURCE
static java.lang.String
NO_IMAGE_RESOURCE
static java.lang.String
PIXEL_IMAGE_RESOURCE
static java.lang.String
PROPERTY_IMAGE_ENCODER
Configuration property specifying the name of the class implementing theJRImageEncoder
interface to be used by the engine.static java.lang.String
PROPERTY_IMAGE_READER
Configuration property specifying the name of the class implementing theJRImageReader
interface to be used by the engine.static java.lang.String
SUBREPORT_IMAGE_RESOURCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JRImageLoader
getInstance(JasperReportsContext jasperReportsContext)
java.awt.Image
loadAwtImageFromBytes(byte[] bytes)
byte[]
loadBytesFromAwtImage(java.awt.Image image, ImageTypeEnum imageType)
Encoding the image object using an image encoder that supports the supplied image type.
-
-
-
Field Detail
-
PROPERTY_IMAGE_READER
public static final java.lang.String PROPERTY_IMAGE_READER
Configuration property specifying the name of the class implementing theJRImageReader
interface to be used by the engine. If not set, the engine will try to an image reader implementation that corresponds to the JVM version.- See Also:
- Constant Field Values
-
PROPERTY_IMAGE_ENCODER
public static final java.lang.String PROPERTY_IMAGE_ENCODER
Configuration property specifying the name of the class implementing theJRImageEncoder
interface to be used by the engine. If not set, the engine will try to an image encoder implementation that corresponds to the JVM version.- See Also:
- Constant Field Values
-
PIXEL_IMAGE_RESOURCE
public static final java.lang.String PIXEL_IMAGE_RESOURCE
- See Also:
- Constant Field Values
-
NO_IMAGE_RESOURCE
public static final java.lang.String NO_IMAGE_RESOURCE
- See Also:
- Constant Field Values
-
SUBREPORT_IMAGE_RESOURCE
public static final java.lang.String SUBREPORT_IMAGE_RESOURCE
- See Also:
- Constant Field Values
-
CHART_IMAGE_RESOURCE
public static final java.lang.String CHART_IMAGE_RESOURCE
- See Also:
- Constant Field Values
-
CROSSTAB_IMAGE_RESOURCE
public static final java.lang.String CROSSTAB_IMAGE_RESOURCE
- See Also:
- Constant Field Values
-
COMPONENT_IMAGE_RESOURCE
public static final java.lang.String COMPONENT_IMAGE_RESOURCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static JRImageLoader getInstance(JasperReportsContext jasperReportsContext)
-
loadBytesFromAwtImage
public byte[] loadBytesFromAwtImage(java.awt.Image image, ImageTypeEnum imageType) throws JRException
Encoding the image object using an image encoder that supports the supplied image type.- Parameters:
image
- the java.awt.Image object to encodeimageType
- the type of the image as specified by one of the constants defined in the JRRenderable interface- Returns:
- the encoded image data
- Throws:
JRException
-
loadAwtImageFromBytes
public java.awt.Image loadAwtImageFromBytes(byte[] bytes) throws JRException
- Throws:
JRException
-
-