GraphicsExtensionsMeasureString Method
Measures the specified string when drawn with the specified
FontInfo.
Namespace: SMath.DrawingAssembly: SMath.Drawing (in SMath.Drawing.dll) Version: 1.4.0.0
public static SizeF MeasureString(
this IGraphics g,
string text,
FontInfo font
)
<ExtensionAttribute>
Public Shared Function MeasureString (
g As IGraphics,
text As String,
font As FontInfo
) As SizeF
public:
[ExtensionAttribute]
static SizeF MeasureString(
IGraphics^ g,
String^ text,
FontInfo^ font
)
[<ExtensionAttribute>]
static member MeasureString :
g : IGraphics *
text : string *
font : FontInfo -> SizeF
- g IGraphics
- text String
- String to measure.
- font FontInfo
- FontInfo that defines the text format of the string.
SizeF
Returns a
SizeF structure that represents the size of
the string specified by the parameters.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IGraphics. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).