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

Font.MeasureFormattedText Method (String, Int32, Int32, Boolean, Int32)

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

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


Visual Basic
Public Function MeasureFormattedText ( _
	text As String, _
	width As Integer, _
	height As Integer, _
	clipping As Boolean, _
	tabSize As Integer _
) As SizeF
public SizeF MeasureFormattedText(
	string text,
	int width,
	int height,
	bool clipping,
	int tabSize



Type: System.String

Multiline formatted text you want to measure.

Type: System.Int32

Width of the destination rectangle.

Type: System.Int32

Height of the destination rectangle.

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.

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 formatted text when it will be drawn.


Width and height parameters specify 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.DrawFormattedText method.

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

See Also