GraphicsPath.AddString メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GraphicsPath.AddString メソッドの意味・解説 

GraphicsPath.AddString メソッド (String, FontFamily, Int32, Single, RectangleF, StringFormat)

パスに文字列を追加します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub AddString ( _
    s As String, _
    family As FontFamily, _
    style As Integer, _
    emSize As Single, _
    layoutRect As RectangleF, _
    format As StringFormat _
)
Dim instance As GraphicsPath
Dim s As String
Dim family As FontFamily
Dim style As Integer
Dim emSize As Single
Dim layoutRect As RectangleF
Dim format As StringFormat

instance.AddString(s, family, style, emSize, layoutRect, format)
public void AddString (
    string s,
    FontFamily family,
    int style,
    float emSize,
    RectangleF layoutRect,
    StringFormat format
)
public:
void AddString (
    String^ s, 
    FontFamily^ family, 
    int style, 
    float emSize, 
    RectangleF layoutRect, 
    StringFormat^ format
)
public void AddString (
    String s, 
    FontFamily family, 
    int style, 
    float emSize, 
    RectangleF layoutRect, 
    StringFormat format
)
public function AddString (
    s : String, 
    family : FontFamily, 
    style : int, 
    emSize : float, 
    layoutRect : RectangleF, 
    format : StringFormat
)

パラメータ

s

追加する String

family

テスト描画を行うときに使用するフォントの名前を表す FontFamily。

style

テキストに関するスタイル情報 (太字斜体など) を表す FontStyle 列挙体。この値は、整数としてキャストする必要があります (後のコード例参照)。

emSize

文字境界決めem 正方形ボックスの高さ。

layoutRect

テキスト外接する四角形を表す RectangleF。

format

行間配置など、テキスト書式設定情報指定する StringFormat。

使用例使用例

例については、AddString(String,FontFamily,Int32,Single,Point,StringFormat) のトピック参照してください

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.AddString メソッド (String, FontFamily, Int32, Single, Point, StringFormat)

パスに文字列を追加します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub AddString ( _
    s As String, _
    family As FontFamily, _
    style As Integer, _
    emSize As Single, _
    origin As Point, _
    format As StringFormat _
)
Dim instance As GraphicsPath
Dim s As String
Dim family As FontFamily
Dim style As Integer
Dim emSize As Single
Dim origin As Point
Dim format As StringFormat

instance.AddString(s, family, style, emSize, origin, format)
public void AddString (
    string s,
    FontFamily family,
    int style,
    float emSize,
    Point origin,
    StringFormat format
)
public:
void AddString (
    String^ s, 
    FontFamily^ family, 
    int style, 
    float emSize, 
    Point origin, 
    StringFormat^ format
)
public void AddString (
    String s, 
    FontFamily family, 
    int style, 
    float emSize, 
    Point origin, 
    StringFormat format
)
public function AddString (
    s : String, 
    family : FontFamily, 
    style : int, 
    emSize : float, 
    origin : Point, 
    format : StringFormat
)

パラメータ

s

追加する String

family

テスト描画を行うときに使用するフォントの名前を表す FontFamily。

style

テキストに関するスタイル情報 (太字斜体など) を表す FontStyle 列挙体。この値は、整数としてキャストする必要があります (後のコード例参照)。

emSize

文字境界決めem 正方形ボックスの高さ。

origin

テキスト開始する点を表す Point

format

行間配置など、テキスト書式設定情報指定する StringFormat。

使用例使用例

次のコード例は、Windows フォームでの使用意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコード次のアクション実行します

重要な点2 つあります1 つは、fontStyle 引数整数としてキャストされることです。AddString メソッドでは、2 つ上の FontStyle メンバ組み合わせて希望するフォント スタイル (この場合ItalicUnderline) を作成できるように、このキャストが必要です。もう 1 つは、DrawPath メソッドではなく FillPath メソッド使用されることです。FillPath使用され場合ソリッド テキスト描画されますが、DrawPath使用され場合テキストアウトライン スタイルなります

Public Sub AddStringExample(ByVal
 e As PaintEventArgs)

    ' Create a GraphicsPath object.
    Dim myPath As New GraphicsPath

    ' Set up all the string parameters.
    Dim stringText As String
 = "Sample Text"
    Dim family As New FontFamily("Arial")
    Dim myfontStyle As Integer
 = CInt(FontStyle.Italic)
    Dim emSize As Integer
 = 26
    Dim origin As New Point(20,
 20)
    Dim format As StringFormat = StringFormat.GenericDefault

    ' Add the string to the path.
    myPath.AddString(stringText, family, myfontStyle, emSize, _
    origin, format)

    'Draw the path to the screen.
    e.Graphics.FillPath(Brushes.Black, myPath)
End Sub
private void AddStringExample(PaintEventArgs
 e)
{
             
    // Create a GraphicsPath object.
    GraphicsPath myPath = new GraphicsPath();
             
    // Set up all the string parameters.
    string stringText = "Sample Text";
    FontFamily family = new FontFamily("Arial");
    int fontStyle = (int)FontStyle.Italic;
    int emSize = 26;
    Point origin = new Point(20, 20);
    StringFormat format = StringFormat.GenericDefault;
             
    // Add the string to the path.
    myPath.AddString(stringText,
        family,
        fontStyle,
        emSize,
        origin,
        format);
             
    //Draw the path to the screen.
    e.Graphics.FillPath(Brushes.Black, myPath);
}
private:
   void AddStringExample( PaintEventArgs^ e )
   {
      // Create a GraphicsPath object.
      GraphicsPath^ myPath = gcnew GraphicsPath;

      // Set up all the string parameters.
      String^ stringText = "Sample Text";
      FontFamily^ family = gcnew FontFamily( "Arial" );
      int fontStyle = (int)FontStyle::Italic;
      int emSize = 26;
      Point origin = Point(20,20);
      StringFormat^ format = StringFormat::GenericDefault;

      // Add the string to the path.
      myPath->AddString( stringText, family, fontStyle, (float)emSize,
 origin, format );

      //Draw the path to the screen.
      e->Graphics->FillPath( Brushes::Black, myPath );
   }
private void AddStringExample(PaintEventArgs
 e)
{
    // Create a GraphicsPath object.
    GraphicsPath myPath = new GraphicsPath();

    // Set up all the string parameters.
    String stringText = "Sample Text";
    FontFamily family = new FontFamily("Arial");
    int fontStyle = (int)(FontStyle.Italic);
    int emSize = 26;
    Point origin = new Point(20, 20);
    StringFormat format = StringFormat.get_GenericDefault();

    // Add the string to the path.
    myPath.AddString(stringText, family, fontStyle, emSize, origin, 
        format);

    //Draw the path to the screen.
    e.get_Graphics().FillPath(Brushes.get_Black(), myPath);
} //AddStringExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.AddString メソッド (String, FontFamily, Int32, Single, PointF, StringFormat)

パスに文字列を追加します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub AddString ( _
    s As String, _
    family As FontFamily, _
    style As Integer, _
    emSize As Single, _
    origin As PointF, _
    format As StringFormat _
)
Dim instance As GraphicsPath
Dim s As String
Dim family As FontFamily
Dim style As Integer
Dim emSize As Single
Dim origin As PointF
Dim format As StringFormat

instance.AddString(s, family, style, emSize, origin, format)
public void AddString (
    string s,
    FontFamily family,
    int style,
    float emSize,
    PointF origin,
    StringFormat format
)
public:
void AddString (
    String^ s, 
    FontFamily^ family, 
    int style, 
    float emSize, 
    PointF origin, 
    StringFormat^ format
)
public void AddString (
    String s, 
    FontFamily family, 
    int style, 
    float emSize, 
    PointF origin, 
    StringFormat format
)
public function AddString (
    s : String, 
    family : FontFamily, 
    style : int, 
    emSize : float, 
    origin : PointF, 
    format : StringFormat
)

パラメータ

s

追加する String

family

テスト描画を行うときに使用するフォントの名前を表す FontFamily。

style

テキストに関するスタイル情報 (太字斜体など) を表す FontStyle 列挙体。この値は、整数としてキャストする必要があります (後のコード例参照)。

emSize

文字境界決めem 正方形ボックスの高さ。

origin

テキスト開始する点を表す PointF。

format

行間配置など、テキスト書式設定情報指定する StringFormat。

使用例使用例

例については、AddString(String,FontFamily,Int32,Single,Point,StringFormat) のトピック参照してください

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.AddString メソッド (String, FontFamily, Int32, Single, Rectangle, StringFormat)

パスに文字列を追加します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub AddString ( _
    s As String, _
    family As FontFamily, _
    style As Integer, _
    emSize As Single, _
    layoutRect As Rectangle, _
    format As StringFormat _
)
Dim instance As GraphicsPath
Dim s As String
Dim family As FontFamily
Dim style As Integer
Dim emSize As Single
Dim layoutRect As Rectangle
Dim format As StringFormat

instance.AddString(s, family, style, emSize, layoutRect, format)
public void AddString (
    string s,
    FontFamily family,
    int style,
    float emSize,
    Rectangle layoutRect,
    StringFormat format
)
public:
void AddString (
    String^ s, 
    FontFamily^ family, 
    int style, 
    float emSize, 
    Rectangle layoutRect, 
    StringFormat^ format
)
public void AddString (
    String s, 
    FontFamily family, 
    int style, 
    float emSize, 
    Rectangle layoutRect, 
    StringFormat format
)
public function AddString (
    s : String, 
    family : FontFamily, 
    style : int, 
    emSize : float, 
    layoutRect : Rectangle, 
    format : StringFormat
)

パラメータ

s

追加する String

family

テスト描画を行うときに使用するフォントの名前を表す FontFamily。

style

テキストに関するスタイル情報 (太字斜体など) を表す FontStyle 列挙体。この値は、整数としてキャストする必要があります (後のコード例参照)。

emSize

文字境界決めem 正方形ボックスの高さ。

layoutRect

テキスト外接する四角形を表す Rectangle

format

行間配置など、テキスト書式設定情報指定する StringFormat。

使用例使用例

例については、AddString(String,FontFamily,Int32,Single,Point,StringFormat) のトピック参照してください

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.AddString メソッド

パスに文字列を追加します
オーバーロードの一覧オーバーロードの一覧

名前 説明
GraphicsPath.AddString (String, FontFamily, Int32, Single, Point, StringFormat) パスに文字列を追加します
GraphicsPath.AddString (String, FontFamily, Int32, Single, PointF, StringFormat) パスに文字列を追加します
GraphicsPath.AddString (String, FontFamily, Int32, Single, Rectangle, StringFormat) パスに文字列を追加します
GraphicsPath.AddString (String, FontFamily, Int32, Single, RectangleF, StringFormat) パスに文字列を追加します
参照参照

関連項目

GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

GraphicsPath.AddString メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GraphicsPath.AddString メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS