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

Measures the specified test when drawn with the specified Font within the specified region.

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

Syntax

C#
public static Size MeasureText(
	string text,
	Font font,
	int width,
	int height,
	bool clipping,
	int tabSize
)

Parameters

text

Type: System.String

A text you want to measure.
font

Type: Aurigma.GraphicsMill.Drawing.Font

A Font that defines the text format.
width

Type: System.Int32

The width of the drawn text.
height

Type: System.Int32

The height of the drawn text.
clipping

Type: System.Boolean

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

Type: System.Int32

The number of whitespaces to replace one tabulation character in the text.

Return Value

A SizeF structure that represents the size of the given text.

Remarks

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 DrawText(String, Font, SolidBrush, Int32, Int32, Int32, Int32, Boolean, Int32) method.

See Also

Reference