Font.DrawText メソッド (Sprite, String, Rectangle, DrawTextFormat, Color)

[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]

書式設定されたテキストを描画します。

名前空間:  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 Color _
) 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 Color
Dim returnValue As Integer

returnValue = instance.DrawText(sprite, _
    value, rectangle, format, color)
public int DrawText(
    Sprite sprite,
    string value,
    Rectangle rectangle,
    DrawTextFormat format,
    Color color
)
public:
int DrawText(
    Sprite^ sprite, 
    String^ value, 
    Rectangle rectangle, 
    DrawTextFormat format, 
    Color color
)
member DrawText : 
        sprite:Sprite * 
        value:string * 
        rectangle:Rectangle * 
        format:DrawTextFormat * 
        color:Color -> int 

パラメーター

  • sprite
    型 : Microsoft.WindowsMobile.DirectX.Direct3D.Sprite
    文字列を格納している Sprite。nullnull 参照 (Visual Basic では Nothing) を指定することもできます。その場合、Direct3D は独自のスプライト オブジェクトで文字列をレンダリングします。

戻り値

型 : 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

参照

参照

Font クラス

Font メンバー

DrawText オーバーロード

Microsoft.WindowsMobile.DirectX.Direct3D 名前空間