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 RectangleC# public Rectangle MeasureString(
Sprite sprite,
string text,
DrawTextFormat format,
int color
);C++ public:
Rectangle MeasureString(
Sprite^ sprite,
String^ text,
DrawTextFormat format,
int color
);JScript public function MeasureString(
sprite : Sprite,
text : String,
format : DrawTextFormat,
color : int
) : Rectangle;
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 Rectangle structure that contains the rectangle, in logical coordinates, that encompasses the formatted text string.