PinnedText

References
public class PinnedText
Creates a preplaced bit of text, either left, centre or right aligned within some frame.

Properties

Font

#
public Font Font { get; }
Gets the font used to align this text.

Frame

#
public RectangleF Frame { get; }
Bounding rectangle.

Text

#
public string Text { get; }
Gets the text.

Methods

Centre

#
public static PinnedText Centre(string text, Font font, RectangleF frame, float offset)
Create left aligned pinned text.
text (string)Text to pin.
font (Font)Font to pin with.
frame (RectangleF)Boundary frame.
offset (float)Horizontal offset. Positive values offset towards the right.

Draw

#
public void Draw(Graphics graphics, Color colour)
Draw this pinned text.
graphics (Graphics)
colour (Color)

Left

#
public static PinnedText Left(string text, Font font, RectangleF frame, float offset)
Create left aligned pinned text.
text (string)Text to pin.
font (Font)Font to pin with.
frame (RectangleF)Boundary frame.
offset (float)Horizontal offset. Positive values offset towards the right.

Rebase

#
public PinnedText Rebase(PointF newFrameLocation)
Relocate this pinned text without re-measuring the string.
newFrameLocation (PointF)

Right

#
public static PinnedText Right(string text, Font font, RectangleF frame, float offset)
Create left aligned pinned text.
text (string)Text to pin.
font (Font)Font to pin with.
frame (RectangleF)Boundary frame.
offset (float)Horizontal offset. Positive values offset towards the left.