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

Graphics.FillPath メソッド

GraphicsPath の内部を塗りつぶします。

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

Public Sub FillPath ( _
    brush As Brush, _
    path As GraphicsPath _
)
Dim instance As Graphics
Dim brush As Brush
Dim path As GraphicsPath

instance.FillPath(brush, path)
public void FillPath (
    Brush brush,
    GraphicsPath path
)
public:
void FillPath (
    Brush^ brush, 
    GraphicsPath^ path
)
public void FillPath (
    Brush brush, 
    GraphicsPath path
)
public function FillPath (
    brush : Brush, 
    path : GraphicsPath
)

パラメータ

brush

塗りつぶしの特性を決定する Brush。

path

塗りつぶし対象のパスを表す GraphicsPath。

例外例外
例外の種類条件

ArgumentNullException

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

または

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

解説解説
使用例使用例

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

Public Sub FillPathEllipse(ByVal
 e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New
 SolidBrush(Color.Red)

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

    ' Fill graphics path to screen.
    e.Graphics.FillPath(redBrush, graphPath)
End Sub
public void FillPathEllipse(PaintEventArgs
 e)
{
             
    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);
             
    // Create graphics path object and add ellipse.
    GraphicsPath graphPath = new GraphicsPath();
    graphPath.AddEllipse(0, 0, 200, 100);
             
    // Fill graphics path to screen.
    e.Graphics.FillPath(redBrush, graphPath);
}
public:
   void FillPathEllipse( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create graphics path object and add ellipse.
      GraphicsPath^ graphPath = gcnew GraphicsPath;
      graphPath->AddEllipse( 0, 0, 200, 100 );

      // Fill graphics path to screen.
      e->Graphics->FillPath( redBrush, graphPath );
   }
public void FillPathEllipse(PaintEventArgs
 e) 
{
    // Create solid brush.
    SolidBrush redBrush =  new SolidBrush(Color.get_Red());

    // Create graphics path object and add ellipse.
    GraphicsPath graphPath =  new GraphicsPath();
    graphPath.AddEllipse(0, 0, 200, 100);

    // Fill graphics path to screen.
    e.get_Graphics().FillPath(redBrush, graphPath);
} //FillPathEllipse
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2026 GRAS Group, Inc.RSS