[]
Measures a string using a specified TextFormat, available layout size and TextSplitOptions. Also calculates and returns in an output parameter the number of chars that fit into the specified size.
public SizeF MeasureString(string text, TextFormat textFormat, SizeF layoutSize, TextSplitOptions splitOptions, out int fitCharCount)
Public Function MeasureString(text As String, textFormat As TextFormat, layoutSize As SizeF, splitOptions As TextSplitOptions, ByRef fitCharCount As Integer) As SizeF
Type | Name | Description |
---|---|---|
string | text | The string to measure. |
TextFormat | textFormat | The text format to use. |
SizeF | layoutSize | The maximum available size for the layout. |
TextSplitOptions | splitOptions | The options controlling how to split the text if it does not fit into the specified size. |
int | fitCharCount | OUT: The number of chars that fit into the specified size. |
Type | Description |
---|---|
SizeF | The actual size needed to draw the string. |
Measures a string using a specified TextFormat, available layout size and default split options (see TextSplitOptions). Also calculates and returns in an output parameter the number of chars that fit into the specified size.
public SizeF MeasureString(string text, TextFormat textFormat, SizeF layoutSize, out int fitCharCount)
Public Function MeasureString(text As String, textFormat As TextFormat, layoutSize As SizeF, ByRef fitCharCount As Integer) As SizeF
Type | Name | Description |
---|---|---|
string | text | The string to measure. |
TextFormat | textFormat | The text format to use. |
SizeF | layoutSize | The maximum available size for the layout. |
int | fitCharCount | OUT: The number of chars that fit into the specified size. |
Type | Description |
---|---|
SizeF | The actual size needed to draw the string. |
Measures a string using a specified font, font size and layout width.
public SizeF MeasureString(string text, Font font, float fontSize, float? width = null)
Public Function MeasureString(text As String, font As Font, fontSize As Single, Optional width As Single? = Nothing) As SizeF
Type | Name | Description |
---|---|---|
string | text | The string to measure. |
Font | font | The font to use. |
float | fontSize | The font size to use. |
float? | width | The width allocated to draw the string, or null to indicate unlimited width. |
Type | Description |
---|---|
SizeF | The size needed to draw the string. |
Measures a string using a specified TextFormat.
public SizeF MeasureString(string text, TextFormat textFormat, float? width = null)
Public Function MeasureString(text As String, textFormat As TextFormat, Optional width As Single? = Nothing) As SizeF
Type | Name | Description |
---|---|---|
string | text | The string to measure. |
TextFormat | textFormat | The text format to use. |
float? | width | The width allocated to draw the string, or null to indicate unlimited width. |
Type | Description |
---|---|
SizeF | The size needed to draw the string. |