Font.MeasureString Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Measures the specified string when drawn with the specified Font object and formatted with the specified StringFormat object.
Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Syntax
'Declaration
Public Function MeasureString ( _
sprite As Sprite, _
value As String, _
ByRef rectangle As Rectangle, _
format As DrawTextFormat _
) As Rectangle
'Usage
Dim instance As Font
Dim sprite As Sprite
Dim value As String
Dim rectangle As Rectangle
Dim format As DrawTextFormat
Dim returnValue As Rectangle
returnValue = instance.MeasureString(sprite, _
value, rectangle, format)
public Rectangle MeasureString(
Sprite sprite,
string value,
ref Rectangle rectangle,
DrawTextFormat format
)
public:
Rectangle MeasureString(
Sprite^ sprite,
String^ value,
Rectangle% rectangle,
DrawTextFormat format
)
member MeasureString :
sprite:Sprite *
value:string *
rectangle:Rectangle byref *
format:DrawTextFormat -> Rectangle
Parameters
- sprite
Type: Microsoft.WindowsMobile.DirectX.Direct3D.Sprite
A Sprite that contains the string. Can be nulla null reference (Nothing in Visual Basic), in which case Direct3D renders the string with its own sprite object.
- value
Type: System.String
The string to measure.
- rectangle
Type: System.Drawing.Rectangle%
A reference to a Rectangle structure that contains the rectangle, in logical coordinates, in which the text is being formatted.
- format
Type: Microsoft.WindowsMobile.DirectX.Direct3D.DrawTextFormat
The method of formatting the text; can be any combination of values from the DrawTextFormat enumeration.
Return Value
Type: System.Drawing.Rectangle
A Rectangle.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Platforms
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Compact Framework
Supported in: 3.5, 2.0