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 As Graphics, _
ByVal As String, _
ByVal As Font, _
ByVal As Color, _
ByVal As RectangleF, _
ByVal As HorizontalAlignment, _
ByVal As VerticalAlignment, _
ByVal As TextOrientation, _
ByVal As Boolean, _
ByVal As Boolean, _
ByVal As HotkeyPrefix, _
ByVal As StringTrimming, _
ByVal As Integer, _
ByVal As Boolean, _
ByVal As Double, _
ByVal 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)
public static SizeF Measure(
Graphics ,
string ,
Font ,
Color ,
RectangleF ,
HorizontalAlignment ,
VerticalAlignment ,
TextOrientation ,
bool ,
bool ,
HotkeyPrefix ,
StringTrimming ,
int ,
bool ,
double ,
int
)
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