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
| Name | Type | Access | 描述 |
|---|---|---|---|
| bounds | RectangleF | r | 获取对象的边界。 |
| center | PointF | r | 获取形状的中心。 |
| font | Font | r/w | 获取或设置用于绘制文本的字体。 |
| has_segments | bool | r | 获取一个值,指示形状是否具有段。 |
| left_bottom | PointF | r | 获取左下矩形点。 |
| left_top | PointF | r | 获取左上矩形点。 |
| rectangle_height | float | r | 获取矩形高度。 |
| rectangle_width | float | r | 获取矩形宽度。 |
| right_bottom | PointF | r | 获取右下矩形点。 |
| right_top | PointF | r | 获取右上矩形点。 |
| segments | ShapeSegment[] | r | 获取形状的段。 |
| text | string | r/w | 获取或设置已绘制的文本。 |
| text_format | StringFormat | r/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:
| 参数 | Type | Description |
|---|---|---|
| text | string | 要绘制的文本。 |
| rectangle | RectangleF | 文本矩形。 |
| font | Font | 要使用的字体。 |
| string_format | StringFormat | 字符串格式。 |
Method: get_bounds(matrix)
get_bounds(matrix)
获取对象的边界。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| matrix | Matrix | 在计算边界之前要应用的矩阵。 |
Returns
| Type | Description |
|---|---|
| RectangleF | 估计的对象边界。 |
Method: get_bounds(matrix, pen)
get_bounds(matrix, pen)
获取对象的边界。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| matrix | Matrix | 在计算边界之前要应用的矩阵。 |
| pen | Pen | 用于对象的笔。这可能会影响对象边界的大小。 |
Returns
| Type | Description |
|---|---|
| RectangleF | 估计的对象边界。 |
Method: transform(transform)
transform(transform)
对形状应用指定的变换。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| transform | Matrix | 要应用的变换。 |