Graphics.DrawString Method (String, Font, SolidBrush, Rectangle, TextTrimmingMode, Boolean, Boolean, Boolean)

Draws the specified text string in the specified rectangle with the specified Font and SolidBrush settings.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void DrawString(
	string string,
	Font font,
	SolidBrush brush,
	Rectangle rect,
	TextTrimmingMode trim,
	bool hotkeyPrefix,
	bool clipping,
	bool wordWrap
)

Parameters

string

Type: System.String

A string to draw.
font

Type: Aurigma.GraphicsMill.Drawing.Font

A Font that defines the text format of the string.
brush

Type: Aurigma.GraphicsMill.Drawing.SolidBrush

A SolidBrush that determines the color of the drawn text.
rect

Type: System.Drawing.Rectangle

A Rectangle structure that specifies the bounds of the drawn text.
trim

Type: Aurigma.GraphicsMill.Drawing.TextTrimmingMode

A TextTrimmingMode specifying how to handle the situation when a text does not fit a given rectangle (where to insert ellipsis).
hotkeyPrefix

Type: System.Boolean

true if the hotkey prefix (ampersand sign) is removed from the string and next character is underlined; otherwise, false.
clipping

Type: System.Boolean

true if the string is clipped when it does not fit the bounding rectangle; otherwise, false.
wordWrap

Type: System.Boolean

true if the wrapped inside the bounding rectangle; otherwise, false.

Remarks

The extent of the text drawn by this method can be measured using the MeasureString(String, Font) method.

Note

When you try to draw text on a grayscale bitmap, you will notice that the text is not antialiased. The reason of this problem is that neither GDI nor GDI+ support grayscale bitmaps, therefore Graphics Mill has to imitate it as indexed bitmap with grayscale palette. However, antialiasing is impossible on indexed bitmaps.

See Also

Reference