public final class TextShape extends RectangleProjectedShape
Represents a text shape.
Constructor and Description |
---|
TextShape()
Initializes a new instance of the
TextShape class. |
TextShape(String text,
RectangleF rectangle,
Font font,
StringFormat stringFormat)
Initializes a new instance of the
TextShape class. |
Modifier and Type | Method and Description |
---|---|
RectangleF |
getBounds()
Gets the object's bounds.
|
RectangleF |
getBounds(Matrix matrix)
Gets the object's bounds.
|
RectangleF |
getBounds(Matrix matrix,
Pen pen)
Gets the object's bounds.
|
PointF |
getCenter()
Gets the shape's center.
|
Font |
getFont()
Gets or sets the font used to draw the text.
|
ShapeSegment[] |
getSegments()
Gets the shape segments.
|
String |
getText()
Gets or sets the drawn text.
|
StringFormat |
getTextFormat()
Gets or sets the text format.
|
boolean |
hasSegments()
Gets a value indicating whether shape has segments.
|
void |
setFont(Font value)
Gets or sets the font used to draw the text.
|
void |
setText(String value)
Gets or sets the drawn text.
|
void |
setTextFormat(StringFormat value)
Gets or sets the text format.
|
void |
transform(Matrix transform)
Applies the specified transformation to the shape.
|
getLeftBottom, getLeftTop, getRectangleHeight, getRectangleWidth, getRightBottom, getRightTop
public TextShape()
Initializes a new instance of the TextShape
class.
public TextShape(String text, RectangleF rectangle, Font font, StringFormat stringFormat)
Initializes a new instance of the TextShape
class.
text
- The text to draw.rectangle
- The text rectangle.font
- The font to use.stringFormat
- The string format.public String getText()
Gets or sets the drawn text.
Value: The drawn text.public void setText(String value)
Gets or sets the drawn text.
Value: The drawn text.public Font getFont()
Gets or sets the font used to draw the text.
Value: The font used to draw the text.public void setFont(Font value)
Gets or sets the font used to draw the text.
Value: The font used to draw the text.public StringFormat getTextFormat()
Gets or sets the text format.
Value: The text format.public void setTextFormat(StringFormat value)
Gets or sets the text format.
Value: The text format.public PointF getCenter()
Gets the shape's center.
Value: The shape's center.getCenter
in class RectangleProjectedShape
public RectangleF getBounds()
Gets the object's bounds.
Value: The object's bounds.getBounds
in class RectangleProjectedShape
public ShapeSegment[] getSegments()
Gets the shape segments.
Value: The shape segments.getSegments
in class Shape
public boolean hasSegments()
Gets a value indicating whether shape has segments.
Value:True
if shape has segments; otherwise, false
.hasSegments
in class RectangleProjectedShape
True
if shape has segments; otherwise, false
.public RectangleF getBounds(Matrix matrix)
Gets the object's bounds.
getBounds
in class RectangleProjectedShape
matrix
- The matrix to apply before bounds will be calculated.public RectangleF getBounds(Matrix matrix, Pen pen)
Gets the object's bounds.
getBounds
in class RectangleProjectedShape
matrix
- The matrix to apply before bounds will be calculated.pen
- The pen to use for object. This can influence the object's bounds size.public void transform(Matrix transform)
Applies the specified transformation to the shape.
transform
in class RectangleProjectedShape
transform
- The transformation to apply.