Share via


Font.MeasureString(Sprite,String,DrawTextFormat,Int32) Method (Microsoft.DirectX.Direct3D)

Measures the rectangular dimensions of the specified text string when drawn with the specified Sprite object and formatted with the specified DrawTextFormat method of formatting text.

Definition

Visual Basic Public Function MeasureString( _
    ByVal sprite As Sprite, _
    ByVal text As String, _
    ByVal format As DrawTextFormat, _
    ByVal color As Integer _
) As RectangleLeave Site
C# public RectangleLeave Site MeasureString(
    Sprite sprite,
    string text,
    DrawTextFormat format,
    int color
);
C++ public:
RectangleLeave Site MeasureString(
    Spritesprite,
    StringLeave Sitetext,
    DrawTextFormat format,
    int color
);
JScript public function MeasureString(
    sprite : Sprite,
    text : String,
    format : DrawTextFormat,
    color : int
) : RectangleLeave Site;

Parameters

sprite Microsoft.DirectX.Direct3D.Sprite
A Sprite object that contains the string.
text System.String
String to measure.
format Microsoft.DirectX.Direct3D.DrawTextFormat
Method of formatting the text; can be any combination of values from the DrawTextFormat enumeration.
color System.Int32
Integer color value.

Return Value

System.Drawing.Rectangle
A RectangleLeave Site structure that contains the rectangle, in logical coordinates, that encompasses the formatted text string.