Package org.apache.poi.hwmf.draw
Class HwmfImageRenderer
java.lang.Object
org.apache.poi.hwmf.draw.HwmfImageRenderer
- All Implemented Interfaces:
EmbeddedExtractor,ImageRenderer
Helper class which is instantiated by
DrawPictureShape
via reflection-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.EmbeddedExtractor
EmbeddedExtractor.EmbeddedPart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if this image renderer implementation supports the given contentTypebooleandrawImage(Graphics2D graphics, Rectangle2D anchor) Render picture data into the supplied graphicsbooleandrawImage(Graphics2D graphics, Rectangle2D anchor, Insets clip) Render picture data into the supplied graphicsgetEmbeddings(Iterable<HwmfEmbedded> embs) getImage()getImage(Dimension2D dim) static Rectangle2DgetOuterBounds(Rectangle2D anchor, Insets clip) voidLoad and buffer the imagevoidloadImage(InputStream data, String contentType) Load and buffer the imagevoidsetAlpha(double alpha) voidsetDefaultCharset(Charset defaultCharset) Sets the default charset to render text elements.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.sl.draw.ImageRenderer
getCachedContentType, getCachedImage, setCacheInput
-
Constructor Details
-
HwmfImageRenderer
public HwmfImageRenderer()
-
-
Method Details
-
canRender
Description copied from interface:ImageRendererDetermines if this image renderer implementation supports the given contentType- Specified by:
canRenderin interfaceImageRenderer- Parameters:
contentType- the image content type- Returns:
- if the content type is supported
-
loadImage
Description copied from interface:ImageRendererLoad and buffer the image- Specified by:
loadImagein interfaceImageRenderer- Parameters:
data- the raw image streamcontentType- the content type- Throws:
IOException
-
loadImage
Description copied from interface:ImageRendererLoad and buffer the image- Specified by:
loadImagein interfaceImageRenderer- Parameters:
data- the raw image bytescontentType- the content type- Throws:
IOException
-
getDimension
- Specified by:
getDimensionin interfaceImageRenderer- Returns:
- the dimension of the buffered image in pixel
-
setAlpha
public void setAlpha(double alpha) - Specified by:
setAlphain interfaceImageRenderer- Parameters:
alpha- the alpha [0..1] to be added to the image (possibly already containing an alpha channel)
-
getImage
- Specified by:
getImagein interfaceImageRenderer- Returns:
- the image as buffered image or null if image could not be loaded
-
getImage
- Specified by:
getImagein interfaceImageRenderer- Parameters:
dim- the dimension in pixels of the returned image- Returns:
- the image as buffered image or null if image could not be loaded
-
drawImage
Description copied from interface:ImageRendererRender picture data into the supplied graphics- Specified by:
drawImagein interfaceImageRenderer- Returns:
- true if the picture data was successfully rendered
-
drawImage
Description copied from interface:ImageRendererRender picture data into the supplied graphics- Specified by:
drawImagein interfaceImageRenderer- Returns:
- true if the picture data was successfully rendered
-
getOuterBounds
-
getGenericRecord
- Specified by:
getGenericRecordin interfaceImageRenderer
-
getEmbeddings
- Specified by:
getEmbeddingsin interfaceEmbeddedExtractor
-
getEmbeddings
@Internal public static Iterable<EmbeddedExtractor.EmbeddedPart> getEmbeddings(Iterable<HwmfEmbedded> embs) -
getNativeBounds
- Specified by:
getNativeBoundsin interfaceImageRenderer- Returns:
- the format-specific / not-normalized bounds of the image
-
getBounds
- Specified by:
getBoundsin interfaceImageRenderer- Returns:
- the bounds of the buffered image in pixel
-
setDefaultCharset
Description copied from interface:ImageRendererSets the default charset to render text elements. Opposed to other windows libraries in POI this simply defaults to Windows-1252.- Specified by:
setDefaultCharsetin interfaceImageRenderer- Parameters:
defaultCharset- the default charset
-