Class TextShape
Represents a text shape.
public sealed class TextShape : RectangleProjectedShape
- Inheritance
-
TextShape
- Inherited Members
Constructors
TextShape()
Initializes a new instance of the TextShape class.
public TextShape()
TextShape(string, RectangleF, Font, StringFormat)
Initializes a new instance of the TextShape class.
public TextShape(string text, RectangleF rectangle, Font font, StringFormat stringFormat)
Parameters
text
stringThe text to draw.
rectangle
RectangleFThe text rectangle.
font
FontThe font to use.
stringFormat
StringFormatThe string format.
Properties
Bounds
Gets the object's bounds.
public override RectangleF Bounds { get; }
Property Value
- RectangleF
The object's bounds.
Center
Gets the shape's center.
public override PointF Center { get; }
Property Value
- PointF
The shape's center.
Font
Gets or sets the font used to draw the text.
public Font Font { get; set; }
Property Value
- Font
The font used to draw the text.
HasSegments
Gets a value indicating whether shape has segments.
public override bool HasSegments { get; }
Property Value
- bool
True
if shape has segments; otherwise,false
.
Segments
Gets the shape segments.
public override ShapeSegment[] Segments { get; }
Property Value
- ShapeSegment[]
The shape segments.
Text
Gets or sets the drawn text.
public string Text { get; set; }
Property Value
- string
The drawn text.
TextFormat
Gets or sets the text format.
public StringFormat TextFormat { get; set; }
Property Value
- StringFormat
The text format.
Methods
Equals(object)
Check if objects are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe other object.
Returns
- bool
The equality comparison result.
GetBounds(Matrix)
Gets the object's bounds.
public override RectangleF GetBounds(Matrix matrix)
Parameters
matrix
MatrixThe matrix to apply before bounds will be calculated.
Returns
- RectangleF
The estimated object's bounds.
GetBounds(Matrix, Pen)
Gets the object's bounds.
public override RectangleF GetBounds(Matrix matrix, Pen pen)
Parameters
matrix
MatrixThe matrix to apply before bounds will be calculated.
pen
PenThe pen to use for object. This can influence the object's bounds size.
Returns
- RectangleF
The estimated object's bounds.
GetHashCode()
Get hash code of the current object.
public override int GetHashCode()
Returns
- int
The hash code.
Transform(Matrix)
Applies the specified transformation to the shape.
public override void Transform(Matrix transform)
Parameters
transform
MatrixThe transformation to apply.