Font.DrawText メソッド (Sprite, String, Rectangle, DrawTextFormat, Int32)
[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]
書式設定されたテキストを描画します。
名前空間: Microsoft.WindowsMobile.DirectX.Direct3D
アセンブリ: Microsoft.WindowsMobile.DirectX (Microsoft.WindowsMobile.DirectX.dll 内)
構文
'宣言
Public Function DrawText ( _
sprite As Sprite, _
value As String, _
rectangle As Rectangle, _
format As DrawTextFormat, _
color As Integer _
) As Integer
'使用
Dim instance As Font
Dim sprite As Sprite
Dim value As String
Dim rectangle As Rectangle
Dim format As DrawTextFormat
Dim color As Integer
Dim returnValue As Integer
returnValue = instance.DrawText(sprite, _
value, rectangle, format, color)
public int DrawText(
Sprite sprite,
string value,
Rectangle rectangle,
DrawTextFormat format,
int color
)
public:
int DrawText(
Sprite^ sprite,
String^ value,
Rectangle rectangle,
DrawTextFormat format,
int color
)
member DrawText :
sprite:Sprite *
value:string *
rectangle:Rectangle *
format:DrawTextFormat *
color:int -> int
パラメーター
- sprite
型 : Microsoft.WindowsMobile.DirectX.Direct3D.Sprite
文字列を格納している Sprite。nullnull 参照 (Visual Basic では Nothing) を指定することもできます。その場合、Direct3D は独自のスプライト オブジェクトで文字列をレンダリングします。
- value
型 : System.String
描画する文字列。
- rectangle
型 : System.Drawing.Rectangle
テキストが書式設定される四角形を論理座標で格納する Rectangle 構造体への参照。
- format
型 : Microsoft.WindowsMobile.DirectX.Direct3D.DrawTextFormat
テキストの書式設定方法。DrawTextFormat 列挙体の値の任意の組み合わせを使用できます。
- color
型 : System.Int32
整数のカラー値。
戻り値
型 : System.Int32
この関数が成功した場合、戻り値は論理単位でのテキストの高さです。書式パラメーターで Center または Bottom が指定されている場合、戻り値は描画されたテキストの上端から下端までのオフセットです。それ以外の場合は 0 を返します。
解説
このメソッドは、BeginScene メソッドから EndScene メソッドまでのコード ブロック内で呼び出す必要があります。
このメソッドは、NoClip 書式が使用されない限りはテキストをクリップするため、指定した四角形の外にテキストが表示されることはありません。すべての書式設定は、SingleLine 書式が指定されない限り、複数の行があることを前提としています。
選択されたフォントが四角形に対して大きすぎる場合、このメソッドは小さいフォントへの置き換えを試みません。
このメソッドは、文字送りと方向がいずれも 0 であるフォントのみをサポートします。
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分的に信頼される側のコードからライブラリの使用」を参照してください。
プラットフォーム
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET フレームワークのシステム要件」を参照してください。
バージョン情報
.NET Compact Framework
サポート対象 : 3.5、2.0