Graphics.MeasureString

Graphics.MeasureString method

Measures the specified text string with specified parameters

public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
ParameterTypeDescription
textStringThe text to measure.
fontFontThe font to measure.
layoutAreaSizeFThe layout area.
stringFormatStringFormatThe string format.

Return Value

Size in pixels of measured text string

See Also