Graphics.MeasureString method

Measures the specified text string with specified parameters

public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameter Type Description
text String The text to measure.
font Font The font to measure.
layoutArea SizeF The layout area.
stringFormat StringFormat The string format.

Return Value

Size in pixels of measured text string

See Also