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

Graphics.DrawPath メソッド

GraphicsPath を描画します。

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

Public Sub DrawPath ( _
    pen As Pen, _
    path As GraphicsPath _
)
Dim instance As Graphics
Dim pen As Pen
Dim path As GraphicsPath

instance.DrawPath(pen, path)
public void DrawPath (
    Pen pen,
    GraphicsPath path
)
public:
void DrawPath (
    Pen^ pen, 
    GraphicsPath^ path
)
public void DrawPath (
    Pen pen, 
    GraphicsPath path
)
public function DrawPath (
    pen : Pen, 
    path : GraphicsPath
)

パラメータ

pen

パスの色、幅、およびスタイルを決定する Pen。

path

描画する GraphicsPath。

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

または

path が null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

Public Sub DrawPathEllipse(ByVal
 e As PaintEventArgs)

    ' Create graphics path object and add ellipse.
    Dim graphPath As New
 GraphicsPath
    graphPath.AddEllipse(0, 0, 200, 100)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Draw graphics path to screen.
    e.Graphics.DrawPath(blackPen, graphPath)
End Sub
public void DrawPathEllipse(PaintEventArgs
 e)
{
             
    // Create graphics path object and add ellipse.
    GraphicsPath graphPath = new GraphicsPath();
    graphPath.AddEllipse(0, 0, 200, 100);
             
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Draw graphics path to screen.
    e.Graphics.DrawPath(blackPen, graphPath);
}
public:
   void DrawPathEllipse( PaintEventArgs^ e )
   {
      // Create graphics path object and add ellipse.
      GraphicsPath^ graphPath = gcnew GraphicsPath;
      graphPath->AddEllipse( 0, 0, 200, 100 );

      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Draw graphics path to screen.
      e->Graphics->DrawPath( blackPen, graphPath );
   }
public void DrawPathEllipse(PaintEventArgs
 e) 
{
    // Create graphics path object and add ellipse.
    GraphicsPath graphPath =  new GraphicsPath();
    graphPath.AddEllipse(0, 0, 200, 100);

    // Create pen.
    Pen blackPen =  new Pen(Color.get_Black(), 3);

    // Draw graphics path to screen.
    e.get_Graphics().DrawPath(blackPen, graphPath);
} //DrawPathEllipse
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphics.DrawPath メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphics.DrawPath メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphics.DrawPath メソッド を検索

英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「Graphics.DrawPath メソッド」の関連用語

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

   

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



Graphics.DrawPath メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS