Search
IGraphics.MeasureString Method (String, Font, Size, StringFormat, Int32@, Int32@)
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,
    Size layoutArea,
    StringFormat stringFormat,
    out int charactersFitted,
    out int linesFilled
)

Visual Basic  Copy Code

Function MeasureString( _
    text As String, _
    font As Font, _
    layoutArea As Size, _
    stringFormat As StringFormat, _
    <System.Runtime.InteropServices.Out()> ByRef charactersFitted As Integer, _
    <System.Runtime.InteropServices.Out()> ByRef linesFilled As Integer _
) As Size

 Parameters

text
The string to measure.
font
A Font object that defines the text format of the string.
layoutArea
A Microsoft.Maui.Graphics.Size that specifies the maximum layout area for the text.
stringFormat
A StringFormat object that represents formatting information, such as line spacing, for the string.
charactersFitted
Number of characters in the string.
linesFilled
Number of text lines in the string.

 Return Value

This method returns a Microsoft.Maui.Graphics.Size 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