Search
IGraphics.MeasureString Method (String, Font, SizeF, 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
Package: MindFusion.Common

 Syntax

C#  Copy Code

SizeF MeasureString (
    string text,
    Font font,
    SizeF layoutArea,
    StringFormat stringFormat,
    ref int charactersFitted,
    ref int linesFilled
)

Visual Basic  Copy Code

Function MeasureString( _
    text As String, _
    font As Font, _
    layoutArea As SizeF, _
    stringFormat As StringFormat, _
    ByRef charactersFitted As Integer, _
    ByRef linesFilled As Integer _
) As SizeF

 Parameters

text
The string to measure.
font
A .NET Font object that defines the text format of the string.
layoutArea
A .NET SizeF structure that specifies the maximum layout area for the text.
stringFormat
A .NET 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 .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