Method DrawText
DrawText(ReadOnlySpan<char>, Font, Brush, RectD)
public abstract void DrawText(ReadOnlySpan<char> text, Font font, Brush brush, RectD bounds)
Parameters
textReadOnlySpan<char>String to draw.
fontFontFont that defines the text format of the string.
brushBrushBrush that determines the color and texture of the drawn text.
boundsRectDRectD structure that specifies the bounds of the drawn text.
DrawText(ReadOnlySpan<char>, Font, Brush, PointD)
public abstract void DrawText(ReadOnlySpan<char> text, Font font, Brush brush, PointD origin)
Parameters
textReadOnlySpan<char>String to draw.
fontFontFont that defines the text format of the string.
brushBrushBrush that determines the color and texture of the drawn text.
originPointDPointD structure that specifies the upper-left corner of the text position on the canvas.
DrawText(ReadOnlySpan<char>, PointD, Font, Color, Color)
Draws text with the specified font, background and foreground colors. This is the fastest method to draw text.
public abstract void DrawText(ReadOnlySpan<char> text, PointD location, Font font, Color foreColor, Color backColor)
Parameters
textReadOnlySpan<char>Text to draw.
locationPointDLocation used to draw the text.
fontFontFont used to draw the text.
foreColorColorForeground color of the text.
backColorColorBackground color of the text. If parameter is equal to Empty, background will not be painted.
DrawText(ReadOnlySpan<char>, PointD)
Draws text with DefaultFont and Default.
public void DrawText(ReadOnlySpan<char> text, PointD origin)
Parameters
textReadOnlySpan<char>String to draw.
originPointDPointD structure that specifies the upper-left corner of the text position on the canvas.
DrawText(ReadOnlySpan<char>, RectD, Font, Color, Color)
Draws text inside the bounds with the specified font, background and foreground colors.
public virtual void DrawText(ReadOnlySpan<char> text, RectD rect, Font font, Color foreColor, Color backColor)
Parameters
textReadOnlySpan<char>Text to draw.
rectRectDBounding rectangle used to draw the text.
fontFontFont used to draw the text.
foreColorColorForeground color of the text.
backColorColorBackground color of the text. If parameter is equal to Empty, background will not be painted.
DrawText(ReadOnlySpan<char>, Font, Brush, RectD, TextFormat)
public virtual RectD DrawText(ReadOnlySpan<char> text, Font font, Brush brush, RectD rect, TextFormat format)
Parameters
textReadOnlySpan<char>String to draw.
fontFontFont that defines the text format of the string.
brushBrushBrush that determines the color and texture of the drawn text.
rectRectDRectD structure that specifies the bounds of the text.
formatTextFormatTextFormat that specifies formatting attributes, such as alignment and trimming, that are applied to the drawn text.
Returns
Remarks
You can pass 0 as width of the rect. In this case wrapping
will not be performed, only line breaks will be applied.