TextShape 类

Summary: Represents a text shape.

Module: aspose.imaging.shapes

Full Name: aspose.imaging.shapes.TextShape

Inheritance: RectangleProjectedShape

Constructors

Name描述
TextShape()初始化一个新的 TextShape 类实例。
TextShape(text, rectangle, font, string_format)初始化一个新的 TextShape 类实例。

Properties

NameTypeAccess描述
boundsRectangleFr获取对象的边界。
centerPointFr获取形状的中心。
fontFontr/w获取或设置用于绘制文本的字体。
has_segmentsboolr获取一个值,指示形状是否具有段。
left_bottomPointFr获取左下矩形点。
left_topPointFr获取左上矩形点。
rectangle_heightfloatr获取矩形高度。
rectangle_widthfloatr获取矩形宽度。
right_bottomPointFr获取右下矩形点。
right_topPointFr获取右上矩形点。
segmentsShapeSegment[]r获取形状的段。
textstringr/w获取或设置已绘制的文本。
text_formatStringFormatr/w获取或设置文本格式。

Methods

Name描述
get_bounds(matrix)获取对象的边界。
get_bounds(matrix, pen)获取对象的边界。
transform(transform)对形状应用指定的变换。

Constructor: TextShape()

 TextShape() 

初始化一个新的 TextShape 类实例。

Constructor: TextShape(text, rectangle, font, string_format)

 TextShape(text, rectangle, font, string_format) 

初始化一个新的 TextShape 类实例。

Parameters:

参数TypeDescription
textstring要绘制的文本。
rectangleRectangleF文本矩形。
fontFont要使用的字体。
string_formatStringFormat字符串格式。

Method: get_bounds(matrix)

 get_bounds(matrix) 

获取对象的边界。

Parameters:

参数TypeDescription
matrixMatrix在计算边界之前要应用的矩阵。

Returns

TypeDescription
RectangleF估计的对象边界。

Method: get_bounds(matrix, pen)

 get_bounds(matrix, pen) 

获取对象的边界。

Parameters:

参数TypeDescription
matrixMatrix在计算边界之前要应用的矩阵。
penPen用于对象的笔。这可能会影响对象边界的大小。

Returns

TypeDescription
RectangleF估计的对象边界。

Method: transform(transform)

 transform(transform) 

对形状应用指定的变换。

Parameters:

参数TypeDescription
transformMatrix要应用的变换。