Document Solutions for Imaging
GrapeCity.Documents.Imaging Assembly / GrapeCity.Documents.Drawing Namespace / GcGraphics Class / MeasureString Method / MeasureString(String,TextFormat,SizeF,Int32) Method
The string to measure.
The text format to use.
The maximum available size for the layout.
OUT: The number of chars that fit into the specified size.

In This Topic
    MeasureString(String,TextFormat,SizeF,Int32) Method
    In This Topic
    Measures a string using a specified GrapeCity.Documents.Text.TextFormat, available layout size and default split options (see GrapeCity.Documents.Text.TextSplitOptions). Also calculates and returns in an output parameter the number of chars that fit into the specified size.
    Syntax
    'Declaration
     
    Public Overloads Function MeasureString( _
       ByVal text As System.String, _
       ByVal textFormat As TextFormat, _
       ByVal layoutSize As System.Drawing.SizeF, _
       ByRef fitCharCount As System.Integer _
    ) As System.Drawing.SizeF
    public System.Drawing.SizeF MeasureString( 
       System.string text,
       TextFormat textFormat,
       System.Drawing.SizeF layoutSize,
       out System.int fitCharCount
    )

    Parameters

    text
    The string to measure.
    textFormat
    The text format to use.
    layoutSize
    The maximum available size for the layout.
    fitCharCount
    OUT: The number of chars that fit into the specified size.

    Return Value

    The actual size needed to draw the string.
    See Also