[]
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)
| 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)
| 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)
| 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)
| 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. |