Top Fields Constructors Methods
org.apache.poi.sl.draw

public Class DrawPictureShape

extends DrawSimpleShape
Class Inheritance
Imports
java.awt.Dimension, .Graphics2D, .Insets, .Paint, java.awt.geom.Rectangle2D, java.io.IOException, java.util.Iterator, .NoSuchElementException, .ServiceConfigurationError, .ServiceLoader, org.apache.logging.log4j.LogManager, .Logger, org.apache.poi.common.usermodel.PictureType, org.apache.poi.poifs.filesystem.FileMagic, org.apache.poi.sl.usermodel.PictureData, .PictureShape, .RectAlign

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
drawContent(Graphics2D
the graphics to draw into
graphics
)

Overrides org.apache.poi.sl.draw.DrawShape.drawContent.

Implements org.apache.poi.sl.draw.Drawable.drawContent.

draw any content within this shape (image, text, etc.).

protected Paint
public static ImageRenderer

Returns:

the image renderer
getImageRenderer
(Graphics2D
the graphics context
graphics
,
String contentType)

Returns an ImageRenderer for the PictureData

protected PictureShape<?, ?>
public void
resize()

Resize this picture to the default size.

public void
resize(Rectangle2D
The target rectangle
target
)

Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.

public void
resize(Rectangle2D
The target rectangle
target
,
RectAlign
The alignment within the target rectangle when resizing. A null value corresponds to RectAlign.CENTER
align
)

Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle based on the specified alignment (gravity).

Inherited from org.apache.poi.sl.draw.DrawSimpleShape:
computeOutlinesdrawdrawDecorationdrawShadowgetHeadDecorationgetLinePaintgetStrokegetTailDecoration

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

DrawPictureShapeback to summary
public DrawPictureShape(PictureShape<?, ?> shape)

Method Detail

drawContentback to summary
public void drawContent(Graphics2D graphics)

Overrides org.apache.poi.sl.draw.DrawShape.drawContent.

Implements org.apache.poi.sl.draw.Drawable.drawContent.

Doc from org.apache.poi.sl.draw.Drawable.drawContent.

draw any content within this shape (image, text, etc.).

Parameters
graphics:Graphics2D

the graphics to draw into

Annotations
@Override
getFillPaintback to summary
protected Paint getFillPaint(Graphics2D graphics)

Overrides org.apache.poi.sl.draw.DrawSimpleShape.getFillPaint.

Annotations
@Override
getImageRendererback to summary
public static ImageRenderer getImageRenderer(Graphics2D graphics, String contentType)

Returns an ImageRenderer for the PictureData

Parameters
graphics:Graphics2D

the graphics context

Returns:ImageRenderer

the image renderer

getShapeback to summary
protected PictureShape<?, ?> getShape()

Overrides org.apache.poi.sl.draw.DrawSimpleShape.getShape.

Annotations
@Override
resizeback to summary
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.

resizeback to summary
public void resize(Rectangle2D target)

Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.

Parameters
target:Rectangle2D

The target rectangle

resizeback to summary
public void resize(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).

Parameters
target:Rectangle2D

The target rectangle

align:RectAlign

The alignment within the target rectangle when resizing. A null value corresponds to RectAlign.CENTER