public class DrawPictureShape extends DrawSimpleShape
Drawable.DrawableHint
BUFFERED_IMAGE, CURRENT_SLIDE, DEFAULT_CHARSET, DRAW_FACTORY, EMF_FORCE_HEADER_BOUNDS, 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 and Description |
---|
DrawPictureShape(PictureShape<?,?> shape) |
Modifier and Type | Method and Description |
---|---|
void |
drawContent(java.awt.Graphics2D graphics)
draw any content within this shape (image, text, etc.).
(在此形状内绘制任何内容(图像、文本等)。)
|
protected java.awt.Paint |
getFillPaint(java.awt.Graphics2D graphics) |
static ImageRenderer |
getImageRenderer(java.awt.Graphics2D graphics, java.lang.String contentType)
Returns an ImageRenderer for the PictureData
(返回 PictureData 的 ImageRenderer)
|
protected PictureShape<?,?> |
getShape() |
void |
resize()
Resize this picture to the default size.
(将此图片调整为默认大小。)
|
void |
resize(java.awt.geom.Rectangle2D target)
Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.
(使图片形状适合目标矩形,保持纵横比并在目标矩形内重新定位并居中对齐。)
|
void |
resize(java.awt.geom.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).
(使图片形状适合目标矩形,保持纵横比并根据指定的对齐方式(重力)在目标矩形内重新定位。)
|
computeOutlines, draw, drawDecoration, drawShadow, getHeadDecoration, getLinePaint, getStroke, getTailDecoration
applyTransform, getAnchor, getAnchor, getStroke
public DrawPictureShape(PictureShape<?,?> shape)
public void drawContent(java.awt.Graphics2D graphics)
Drawable
drawContent
in interface
Drawable
(接口Drawable中的drawContent)
drawContent
in class
DrawShape
graphics
- the graphics to draw into
(graphics - 要绘制的图形)
public static ImageRenderer getImageRenderer(java.awt.Graphics2D graphics, java.lang.String contentType)
graphics
- the graphics context
(graphics - 图形上下文)
protected java.awt.Paint getFillPaint(java.awt.Graphics2D graphics)
getFillPaint
in class
DrawSimpleShape
protected PictureShape<?,?> getShape()
getShape
in class
DrawSimpleShape
public void resize()
public void resize(java.awt.geom.Rectangle2D target)
target
- The target rectangle
(target - 目标矩形)
public void resize(java.awt.geom.Rectangle2D target, RectAlign align)
target
- The target rectangle
(target - 目标矩形)
align
- The alignment within the target rectangle when resizing. A null value corresponds to RectAlign.CENTER
(align - 调整大小时目标矩形内的对齐方式。一个空值对应于 RectAlign.CENTER)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.