Table of Contents

Method MeasureText

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

MeasureText(string, Font, double)

Measures the specified string when drawn with the specified Font and maximum width.

SizeD MeasureText(string text, Font font, double maximumWidth)

Parameters

text string

String to measure.

font Font

Font that defines the text format of the string.

maximumWidth double

Maximum width of the string in device-independent units.

Returns

SizeD

This method returns a SizeD structure that represents the size, in device-independent units, of the string specified by the text parameter as drawn with the font parameter.

MeasureText(string, Font, double, TextFormat)

Measures the specified string when drawn with the specified Font, maximum width and TextFormat.

SizeD MeasureText(string text, Font font, double maximumWidth, TextFormat format)

Parameters

text string

String to measure.

font Font

Font that defines the text format of the string.

maximumWidth double

Maximum width of the string in device-independent units.

format TextFormat

TextFormat that specifies formatting attributes, such as alignment and trimming, that are applied to the drawn text.

Returns

SizeD

This method returns a SizeD structure that represents the size, in device-independent units, of the string specified by the text parameter as drawn with the font parameter.