Spread Windows Forms 17
FarPoint.Win Assembly / FarPoint.Win.Text Namespace / TextHelper Class / Measure Method / Measure(Graphics,String,Font,Color,RectangleF,HorizontalAlignment,VerticalAlignment,TextOrientation,Boolean,Boolean,HotkeyPrefix,StringTrimming,Int32,Boolean,Double,Int32) Method
Graphics device interface for measuring the text on
Text to measure
Font of the text
Color of the text
Bounding rectangle of the text
Horizontal alignment settings of the text relative to its bounding rectangle
Vertical alignment settings of the text relative to its bounding rectangle
Orientation of the text
Whether the text is wrapped to multiple lines
Whether multiple lines are allowed
Hotkey prefix
Trimming effect of the text
Height of the rectangle
Whether to adjust the bounding rectangle of the text
Rotation angle of the text
Number of pixels to indent the text


In This Topic
    Measure(Graphics,String,Font,Color,RectangleF,HorizontalAlignment,VerticalAlignment,TextOrientation,Boolean,Boolean,HotkeyPrefix,StringTrimming,Int32,Boolean,Double,Int32) Method
    In This Topic
    Determines the size of the text.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function Measure( _
       ByVal g As Graphics, _
       ByVal s As String, _
       ByVal font As Font, _
       ByVal foreColor As Color, _
       ByVal rectangle As RectangleF, _
       ByVal halign As HorizontalAlignment, _
       ByVal valign As VerticalAlignment, _
       ByVal textOrientation As TextOrientation, _
       ByVal wordWrap As Boolean, _
       ByVal multiline As Boolean, _
       ByVal hotkeyPrefix As HotkeyPrefix, _
       ByVal stringTrim As StringTrimming, _
       ByVal drawRectHeight As Integer, _
       ByVal adjust As Boolean, _
       ByVal rotationAngle As Double, _
       ByVal textIndent As Integer _
    ) As SizeF
    'Usage
     
    
    Dim g As Graphics
    Dim s As String
    Dim font As Font
    Dim foreColor As Color
    Dim rectangle As RectangleF
    Dim halign As HorizontalAlignment
    Dim valign As VerticalAlignment
    Dim textOrientation As TextOrientation
    Dim wordWrap As Boolean
    Dim multiline As Boolean
    Dim hotkeyPrefix As HotkeyPrefix
    Dim stringTrim As StringTrimming
    Dim drawRectHeight As Integer
    Dim adjust As Boolean
    Dim rotationAngle As Double
    Dim textIndent As Integer
    Dim value As SizeF
     
    value = TextHelper.Measure(g, s, font, foreColor, rectangle, halign, valign, textOrientation, wordWrap, multiline, hotkeyPrefix, stringTrim, drawRectHeight, adjust, rotationAngle, textIndent)

    Parameters

    g
    Graphics device interface for measuring the text on
    s
    Text to measure
    font
    Font of the text
    foreColor
    Color of the text
    rectangle
    Bounding rectangle of the text
    halign
    Horizontal alignment settings of the text relative to its bounding rectangle
    valign
    Vertical alignment settings of the text relative to its bounding rectangle
    textOrientation
    Orientation of the text
    wordWrap
    Whether the text is wrapped to multiple lines
    multiline
    Whether multiple lines are allowed
    hotkeyPrefix
    Hotkey prefix
    stringTrim
    Trimming effect of the text
    drawRectHeight
    Height of the rectangle
    adjust
    Whether to adjust the bounding rectangle of the text
    rotationAngle
    Rotation angle of the text
    textIndent
    Number of pixels to indent the text
    See Also