Class TextShape
Namespace: Aspose.Imaging.Shapes
Assembly: Aspose.Imaging.dll (25.2.0)
Represents a text shape.
[JsonObject(MemberSerialization.OptIn)]
public sealed class TextShape : RectangleProjectedShape
Inheritance
object ← ObjectWithBounds ← Shape ← RectangleProjectedShape ← TextShape
Inherited Members
RectangleProjectedShape.GetBounds(Matrix), RectangleProjectedShape.GetBounds(Matrix, Pen), RectangleProjectedShape.Transform(Matrix), RectangleProjectedShape.Equals(object), RectangleProjectedShape.GetHashCode(), RectangleProjectedShape.LeftTop, RectangleProjectedShape.RightTop, RectangleProjectedShape.LeftBottom, RectangleProjectedShape.RightBottom, RectangleProjectedShape.Center, RectangleProjectedShape.Bounds, RectangleProjectedShape.RectangleWidth, RectangleProjectedShape.RectangleHeight, RectangleProjectedShape.HasSegments, Shape.Equals(object), Shape.GetHashCode(), Shape.Center, Shape.Segments, Shape.HasSegments, ObjectWithBounds.GetBounds(Matrix), ObjectWithBounds.GetBounds(Matrix, Pen), ObjectWithBounds.Transform(Matrix), ObjectWithBounds.Equals(object), ObjectWithBounds.GetHashCode(), ObjectWithBounds.Bounds, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
TextShape()
Initializes a new instance of the Aspose.Imaging.Shapes.TextShape class.
[JsonConstructor]
public TextShape()
TextShape(string, RectangleF, Font, StringFormat)
Initializes a new instance of the Aspose.Imaging.Shapes.TextShape class.
public TextShape(string text, RectangleF rectangle, Font font, StringFormat stringFormat)
Parameters
text
string
The text to draw.
rectangle
RectangleF
The text rectangle.
font
Font
The font to use.
stringFormat
StringFormat
The string format.
Properties
Bounds
Gets the object’s bounds.
[JsonIgnore]
public override RectangleF Bounds { get; }
Property Value
Center
Gets the shape’s center.
[JsonIgnore]
public override PointF Center { get; }
Property Value
Font
Gets or sets the font used to draw the text.
public Font Font { get; set; }
Property Value
HasSegments
Gets a value indicating whether shape has segments.
[JsonIgnore]
public override bool HasSegments { get; }
Property Value
Segments
Gets the shape segments.
[JsonIgnore]
public override ShapeSegment[] Segments { get; }
Property Value
Text
Gets or sets the drawn text.
public string Text { get; set; }
Property Value
TextFormat
Gets or sets the text format.
public StringFormat TextFormat { get; set; }
Property Value
Methods
Equals(object)
Check if objects are equal.
public override bool Equals(object obj)
Parameters
obj
object
The other object.
Returns
The equality comparison result.
GetBounds(Matrix)
Gets the object’s bounds.
public override RectangleF GetBounds(Matrix matrix)
Parameters
matrix
Matrix
The matrix to apply before bounds will be calculated.
Returns
The estimated object’s bounds.
GetBounds(Matrix, Pen)
Gets the object’s bounds.
public override RectangleF GetBounds(Matrix matrix, Pen pen)
Parameters
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
The estimated object’s bounds.
GetHashCode()
Get hash code of the current object.
public override int GetHashCode()
Returns
The hash code.
Transform(Matrix)
Applies the specified transformation to the shape.
public override void Transform(Matrix transform)
Parameters
transform
Matrix
The transformation to apply.