Search
IGraphics.MeasureString Method (String, Font, Double, StringFormat)
See Also
 





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

Namespace: MindFusion.Drawing
Assembly: MindFusion.Common

 Syntax

C#  Copy Code

Size MeasureString (
    string text,
    Font font,
    double maxWidth,
    StringFormat format
)

Visual Basic  Copy Code

Function MeasureString( _
    text As String, _
    font As Font, _
    maxWidth As Double, _
    format As StringFormat _
) As Size

 Parameters

text
The string to measure.
font
A Font object that defines the text format of the string.
maxWidth
The maximum width of the string.
format
A StringFormat object that represents formatting information, such as line spacing, for the string.

 Return Value

This method returns a Microsoft.Maui.Graphics.Size that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.

 See Also