TextShape Class
Contents
[
Hide
]Summary: Represents a text shape.
Module: aspose.psd.shapes
Full Name: aspose.psd.shapes.TextShape
Inheritance: RectangleProjectedShape
Aspose.PSD Version: 24.12.0
Constructors
| Name | Description |
|---|---|
| TextShape() | Initializes a new instance of the TextShape class. |
| TextShape(text, rectangle, font, string_format) | Initializes a new instance of the TextShape class. |
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| bounds | RectangleF | r | Gets the object’s bounds. |
| center | PointF | r | Gets the shape’s center. |
| font | Font | r/w | Gets or sets the font used to draw the text. |
| has_segments | bool | r | Gets a value indicating whether shape has segments. |
| left_bottom | PointF | r | Gets the left bottom rectangle point. |
| left_top | PointF | r | Gets the left top rectangle point. |
| rectangle_height | double | r | Gets the rectangle height. |
| rectangle_width | double | r | Gets the rectangle width. |
| right_bottom | PointF | r | Gets the right bottom rectangle point. |
| right_top | PointF | r | Gets the right top rectangle point. |
| segments | ShapeSegment[] | r | Gets the shape segments. |
| text | string | r/w | Gets or sets the drawn text. |
| text_format | StringFormat | r/w | Gets or sets the text format. |
Methods
| Name | Description |
|---|---|
| get_bounds(matrix) | Gets the object’s bounds. |
| get_bounds(matrix, pen) | Gets the object’s bounds. |
| transform(transform) | Applies the specified transformation to the shape. |
Constructor: TextShape()
TextShape()
Initializes a new instance of the TextShape class.
Constructor: TextShape(text, rectangle, font, string_format)
TextShape(text, rectangle, font, string_format)
Initializes a new instance of the TextShape class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to draw. |
| rectangle | RectangleF | The text rectangle. |
| font | Font | The font to use. |
| string_format | StringFormat | The string format. |
Method: get_bounds(matrix)
get_bounds(matrix)
Gets the object’s bounds.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| matrix | Matrix | The matrix to apply before bounds will be calculated. |
Returns
| Type | Description |
|---|---|
| RectangleF | The estimated object’s bounds. |
Method: get_bounds(matrix, pen)
get_bounds(matrix, pen)
Gets the object’s bounds.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| matrix | Matrix | The matrix to apply before bounds will be calculated. |
| pen | Pen | The pen to use for object. This can influence the object’s bounds size. |
Returns
| Type | Description |
|---|---|
| RectangleF | The estimated object’s bounds. |
Method: transform(transform)
transform(transform)
Applies the specified transformation to the shape.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| transform | Matrix | The transformation to apply. |