Share via


Font.MeasureString(Sprite,String,DrawTextFormat,Color) 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 ColorLeave Site _
) As RectangleLeave Site
C# public RectangleLeave Site MeasureString(
    Sprite sprite,
    string text,
    DrawTextFormat format,
    ColorLeave Site color
);
C++ public:
RectangleLeave Site MeasureString(
    Spritesprite,
    StringLeave Sitetext,
    DrawTextFormat format,
    ColorLeave Site color
);
JScript public function MeasureString(
    sprite : Sprite,
    text : String,
    format : DrawTextFormat,
    color : ColorLeave Site
) : 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.Drawing.Color
Color of the text. For more information, see ColorLeave Site.

Return Value

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