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

Measures the specified formatted 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 MeasureFormattedText(
	string text,
	Font font,
	Size size,
	bool clipping,
	int tabSize
)

Parameters

text

Type: System.String

A formatted text you want to measure.
font

Type: Aurigma.GraphicsMill.Drawing.Font

A Font that defines the text format.
size

Type: System.Drawing.Size

A Size structure that specifies the size 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

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

Remarks

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

See Also

Reference