This documentation is for the old version. Go to the latest Graphics Mill docs

GdiGraphics.DrawString Method (String, Font, SolidBrush, Int32, Int32, Int32, Int32, TextTrimmingMode, Boolean, Boolean, Boolean)

Draws a string in specified rectangle (automatically wrapping it if necessary).

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

Syntax

Visual Basic
Public Sub DrawString ( _
	s As String, _
	font As Font, _
	brush As SolidBrush, _
	x As Integer, _
	y As Integer, _
	width As Integer, _
	height As Integer, _
	trim As TextTrimmingMode, _
	hotkeyPrefix As Boolean, _
	clipping As Boolean, _
	wordWrap As Boolean _
)
C#
public void DrawString(
	string s,
	Font font,
	SolidBrush brush,
	int x,
	int y,
	int width,
	int height,
	TextTrimmingMode trim,
	bool hotkeyPrefix,
	bool clipping,
	bool wordWrap
)

Parameters

s

Type: System.String

String to draw.
font

Type: Aurigma.GraphicsMill.Drawing.Font

Font object specifying text rendering options.
brush

Type: Aurigma.GraphicsMill.Drawing.SolidBrush

SolidBrush object containing font color.
x

Type: System.Int32

X-coordinate of the left top corner of the destination rectangle.
y

Type: System.Int32

Y-coordinate of the left top corner of the destination rectangle.
width

Type: System.Int32

Width of the destination rectangle.
height

Type: System.Int32

Height of the destination rectangle.
trim

Type: Aurigma.GraphicsMill.Drawing.TextTrimmingMode

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

Type: System.Boolean

Value specifying if to handle hotkey prefix (ampersand sign). If true, ampersand is removed from the string and next character is underlined.
clipping

Type: System.Boolean

Value specifying if to clip the string when it does not fit the bounding rectangle.
wordWrap

Type: System.Boolean

Value specifying if to wrap the string inside the bounding rectangle.

Remarks

All the coordinates are measured in units specified with Unit property.

Note

If you draw text on indexed bitmaps, antialiasing is disabled regardless to the Antialiased property value. Also, if the GdiGraphics was created on the base of the Bitmap which has Format8bppGrayScale pixel format, antialiasing will not be applied for text output. The reason of this issue is that GDI does not support grayscale bitmaps. That's why Graphics Mill for .NET represents this image as Format8bppIndexed bitmap with grayscale palette.

See Also

Reference