Graphics.FillPath(Brush, GraphicsPath) Graphics.FillPath(Brush, GraphicsPath) Graphics.FillPath(Brush, GraphicsPath) Method

정의

GraphicsPath의 내부를 채웁니다.Fills the interior of a GraphicsPath.

public:
 void FillPath(System::Drawing::Brush ^ brush, System::Drawing::Drawing2D::GraphicsPath ^ path);
public void FillPath (System.Drawing.Brush brush, System.Drawing.Drawing2D.GraphicsPath path);
member this.FillPath : System.Drawing.Brush * System.Drawing.Drawing2D.GraphicsPath -> unit

매개 변수

brush
Brush Brush Brush

채우기의 특징을 결정하는 Brush입니다.Brush that determines the characteristics of the fill.

path
GraphicsPath GraphicsPath GraphicsPath

채울 경로를 나타내는 GraphicsPath입니다.GraphicsPath that represents the path to fill.

예외

brushnull인 경우brush is null.

또는-or- pathnull인 경우path is null.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 이 코드에서는 다음 작업을 수행합니다.The code performs the following actions:

  • 빨간색 단색 브러시를 만듭니다.Creates a solid red brush.

  • 그래픽 경로 개체를 만듭니다.Creates a graphics path object.

  • 타원의 그래픽 경로를 추가합니다.Adds an ellipse to the graphics path.

  • 화면에서 경로 채웁니다.Fills the path on the screen.

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.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 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

설명

GraphicsPath 는 일련의 선과 곡선 세그먼트로 구성 됩니다.A GraphicsPath consists of a series of line and curve segments. 표시 되는 경로 path 매개 변수 닫혀 있지 않으며, 추가 세그먼트가에 추가 됩니다 마지막 지점에서 첫 번째 요소 경로를 닫습니다.If the path represented by the path parameter is not closed, an additional segment is added from the last point to the first point to close the path.

적용 대상