Package org.apache.poi.sl.draw
Class DrawPictureShape
java.lang.Object
org.apache.poi.sl.draw.DrawShape
org.apache.poi.sl.draw.DrawSimpleShape
org.apache.poi.sl.draw.DrawPictureShape
- All Implemented Interfaces:
Drawable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.Drawable
Drawable.DrawableHint -
Field Summary
Fields inherited from interface org.apache.poi.sl.draw.Drawable
CURRENT_SLIDE, DRAW_FACTORY, FONT_FALLBACK, FONT_HANDLER, FONT_MAP, GRADIENT_SHAPE, GRESTORE, GROUP_TRANSFORM, GSAVE, IMAGE_RENDERER, PRESET_GEOMETRY_CACHE, TEXT_AS_CHARACTERS, TEXT_AS_SHAPES, TEXT_RENDERING_MODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawContent(Graphics2D graphics) draw any content within this shape (image, text, etc.).static ImageRenderergetImageRenderer(Graphics2D graphics, String contentType) Returns an ImageRenderer for the PictureDataprotected PictureShape<?,?> getShape()voidresize()Resize this picture to the default size.voidresize(Rectangle2D target) Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.voidresize(Rectangle2D target, RectAlign align) Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle based on the specified alignment (gravity).Methods inherited from class org.apache.poi.sl.draw.DrawSimpleShape
computeOutlines, draw, drawDecoration, drawShadow, getCustomGeometry, getCustomGeometry, getHeadDecoration, getStroke, getTailDecorationMethods inherited from class org.apache.poi.sl.draw.DrawShape
applyTransform, getAnchor, getAnchor, getStroke
-
Constructor Details
-
DrawPictureShape
-
-
Method Details
-
drawContent
Description copied from interface:Drawabledraw any content within this shape (image, text, etc.).- Specified by:
drawContentin interfaceDrawable- Overrides:
drawContentin classDrawShape- Parameters:
graphics- the graphics to draw into
-
getImageRenderer
Returns an ImageRenderer for the PictureData- Parameters:
graphics-- Returns:
- the image renderer
-
getShape
- Overrides:
getShapein classDrawSimpleShape
-
resize
public void resize()Resize this picture to the default size. For PNG and JPEG resizes the image to 100%, for other types, if the size can't be determined it will be 200x200 pixels. -
resize
Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.- Parameters:
target- The target rectangle
-
resize
Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle based on the specified alignment (gravity).- Parameters:
target- The target rectanglealign- The alignment within the target rectangle when resizing. A null value corresponds to RectAlign.CENTER
-