Search
GdiGraphics.MeasureString Method (String, Font, PointF, StringFormat)
See Also
 





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

Namespace: MindFusion.Drawing
Package: MindFusion.Common

 Syntax

C#  Copy Code

public virtual SizeF MeasureString (
    string text,
    Font font,
    PointF origin,
    StringFormat stringFormat
)

Visual Basic  Copy Code

Public Overridable Function MeasureString( _
    text As String, _
    font As Font, _
    origin As PointF, _
    stringFormat As StringFormat _
) As SizeF

 Parameters

text
The string to measure.
font
A .NET Font object defines the text format of the string.
origin
A .NET PointF structure that represents the upper-left corner of the string.
stringFormat
A .NET StringFormat object that represents formatting information, such as line spacing, for the string.

 Return Value

This method returns a .NET SizeF structure that represents the size of the string, in pixels, of the text parameter as drawn with the font parameter and the stringFormat parameter.

 See Also