Graphics.MeasureString
MeasureString(string, Font)
Measures the specified string when drawn with the specified Font.
public SizeF MeasureString(string text, Font font)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font that defines the text format of the string. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified by the text parameter as drawn with the font parameter.
See Also
- struct SizeF
- class Font
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing
MeasureString(string, Font, SizeF)
Measures the specified string when drawn with the specified Font.
public SizeF MeasureString(string text, Font font, SizeF layoutArea)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font that defines the text format of the string. |
layoutArea | SizeF | SizeF structure that specifies the maximum layout area for the text. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified by the text parameter as drawn with the font parameter.
See Also
- struct SizeF
- class Font
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing
MeasureString(string, Font, int)
Measures the specified string when drawn with the specified Font.
public SizeF MeasureString(string text, Font font, int width)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font that defines the text format of the string. |
width | Int32 | Maximum width of the string in pixels. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified by the text parameter as drawn with the font parameter.
See Also
- struct SizeF
- class Font
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing
MeasureString(string, Font, PointF, StringFormat)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
public SizeF MeasureString(string text, Font font, PointF origin, StringFormat stringFormat)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font defines the text format of the string. |
origin | PointF | PointF structure that represents the upper-left corner of the string. |
stringFormat | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified by the text parameter as drawn with the font parameter and the stringFormat parameter.
See Also
- struct SizeF
- class Font
- struct PointF
- class StringFormat
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing
MeasureString(string, Font, int, StringFormat)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
public SizeF MeasureString(string text, Font font, int width, StringFormat format)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font that defines the text format of the string. |
width | Int32 | Maximum width of the string. |
format | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter and the format parameter.
See Also
- struct SizeF
- class Font
- class StringFormat
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing
MeasureString(string, Font, SizeF, StringFormat)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font defines the text format of the string. |
layoutArea | SizeF | SizeF structure that specifies the maximum layout area for the text. |
stringFormat | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.
See Also
- struct SizeF
- class Font
- class StringFormat
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing
MeasureString(string, Font, SizeF, StringFormat, out int, out int)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat,
out int charactersFitted, out int linesFilled)
Parameter | Type | Description |
---|---|---|
text | String | String to measure. |
font | Font | Font defines the text format of the string. |
layoutArea | SizeF | SizeF structure that specifies the maximum layout area for the text. |
stringFormat | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
charactersFitted | Int32& | Number of characters in the string. |
linesFilled | Int32& | Number of text lines in the string. |
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.
See Also
- struct SizeF
- class Font
- class StringFormat
- class Graphics
- namespace System.Drawing
- assembly Aspose.Drawing