Method MeasureText
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
stringString to measure.
font
FontFont that defines the text format of the string.
maximumWidth
doubleMaximum 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 thefont
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
stringString to measure.
font
FontFont that defines the text format of the string.
maximumWidth
doubleMaximum width of the string in device-independent units.
format
TextFormatTextFormat that specifies formatting attributes, such as alignment and trimming, that are applied to the drawn text.