Package org.apache.poi.hwmf.draw
Class HwmfSLImageRenderer
- java.lang.Object
-
- org.apache.poi.hwmf.draw.HwmfSLImageRenderer
-
- All Implemented Interfaces:
ImageRenderer
public class HwmfSLImageRenderer extends java.lang.Object implements ImageRenderer
Helper class which is instantiated byDrawPictureShape
via reflection
-
-
Constructor Summary
Constructors Constructor Description HwmfSLImageRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
drawImage(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D anchor)
Render picture data into the supplied graphicsboolean
drawImage(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D anchor, java.awt.Insets clip)
Render picture data into the supplied graphicsjava.awt.Dimension
getDimension()
java.awt.image.BufferedImage
getImage()
java.awt.image.BufferedImage
getImage(java.awt.Dimension dim)
void
loadImage(byte[] data, java.lang.String contentType)
Load and buffer the imagevoid
loadImage(java.io.InputStream data, java.lang.String contentType)
Load and buffer the imagevoid
setAlpha(double alpha)
-
-
-
Method Detail
-
loadImage
public void loadImage(java.io.InputStream data, java.lang.String contentType) throws java.io.IOException
Description copied from interface:ImageRenderer
Load and buffer the image- Specified by:
loadImage
in interfaceImageRenderer
- Parameters:
data
- the raw image streamcontentType
- the content type- Throws:
java.io.IOException
-
loadImage
public void loadImage(byte[] data, java.lang.String contentType) throws java.io.IOException
Description copied from interface:ImageRenderer
Load and buffer the image- Specified by:
loadImage
in interfaceImageRenderer
- Parameters:
data
- the raw image bytescontentType
- the content type- Throws:
java.io.IOException
-
getDimension
public java.awt.Dimension getDimension()
- Specified by:
getDimension
in interfaceImageRenderer
- Returns:
- the dimension of the buffered image
-
setAlpha
public void setAlpha(double alpha)
- Specified by:
setAlpha
in interfaceImageRenderer
- Parameters:
alpha
- the alpha [0..1] to be added to the image (possibly already containing an alpha channel)
-
getImage
public java.awt.image.BufferedImage getImage()
- Specified by:
getImage
in interfaceImageRenderer
- Returns:
- the image as buffered image
-
getImage
public java.awt.image.BufferedImage getImage(java.awt.Dimension dim)
- Specified by:
getImage
in interfaceImageRenderer
- Parameters:
dim
- the dimension in pixels of the returned image- Returns:
- the image as buffered image
-
drawImage
public boolean drawImage(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D anchor)
Description copied from interface:ImageRenderer
Render picture data into the supplied graphics- Specified by:
drawImage
in interfaceImageRenderer
- Returns:
- true if the picture data was successfully rendered
-
drawImage
public boolean drawImage(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D anchor, java.awt.Insets clip)
Description copied from interface:ImageRenderer
Render picture data into the supplied graphics- Specified by:
drawImage
in interfaceImageRenderer
- Returns:
- true if the picture data was successfully rendered
-
-