[]
        
(Showing Draft Content)

C1.Framework.Drawing.Gdi.Graphics.MeasureString

MeasureString Method

MeasureString(string, Font, Size, StringFormat)

Measures the specified string when drawn with the specified Font object and formatted with the specified StringFormat object.

Declaration
public Size MeasureString(string s, Font font, Size layoutArea, StringFormat format)
Parameters
Type Name Description
string s

String to measure.

Font font

Font object defines the text format of the string.

Size layoutArea

Size structure that specifies the maximum layout area for the text.

StringFormat format

StringFormat object that represents formatting information, such as line spacing, for the string.

Returns
Type Description
Size

The MeasureString method is designed for use with individual strings and includes a small amount of extra space before and after the string to allow for overhanging glyphs. Also, the DrawString method adjusts glyph points to optimize display quality and might display a string narrower than reported by MeasureString.