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

Font.MeasureText Method (String, SizeF, Boolean, Int32)

Gets extent of the given text (both width and height) when it will be drawn with the GdiGraphics.DrawText method.

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

Syntax

Visual Basic
Public Function MeasureText ( _
	text As String, _
	size As SizeF, _
	clipping As Boolean, _
	tabSize As Integer _
) As SizeF
C#
public SizeF MeasureText(
	string text,
	SizeF size,
	bool clipping,
	int tabSize
)

Parameters

text

Type: System.String

Multiline text you want to measure.
size

Type: System.Drawing.SizeF

Width and height of the destination rectangle.
clipping

Type: System.Boolean

Value specifying whether to take into account the destination rectangle. If this value is false the whole text is processed, otherwise only the part which fits the destination rectangle will be measured.
tabSize

Type: System.Int32

Value which specifies the number of whitespaces to replace one tabulation character in the text.

Return Value

Dimensions of the rectangle occupied with text when it will be drawn.

Remarks

Size parameter specifies the desired rectangle you want to display the text inside. The return value is the actual dimensions of the rectangle the text will occupy when displaying.

To get a valid text size, parameters values passed to this method should be identical to the respective parameters of the GdiGraphics.DrawText method.

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

See Also

Reference

Manual