Graphics.DrawPath(Pen, GraphicsPath) Graphics.DrawPath(Pen, GraphicsPath) Graphics.DrawPath(Pen, GraphicsPath) Method

정의

GraphicsPath를 그립니다.Draws a GraphicsPath.

public:
 void DrawPath(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::GraphicsPath ^ path);
public void DrawPath (System.Drawing.Pen pen, System.Drawing.Drawing2D.GraphicsPath path);
member this.DrawPath : System.Drawing.Pen * System.Drawing.Drawing2D.GraphicsPath -> unit

매개 변수

pen
Pen Pen Pen

경로의 색, 너비 및 스타일을 결정하는 Pen입니다.Pen that determines the color, width, and style of the path.

예외

pennull입니다.pen 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 graphics path object and adds an ellipse to it.

  • Black 펜을 만듭니다.Creates a black pen.

  • 화면에 그래픽 경로를 그립니다.Draws the graphics path to the screen.

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.Black, 3);
             
    // Draw graphics path to screen.
    e.Graphics.DrawPath(blackPen, graphPath);
}
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

설명

그래픽 컨텍스트에 현재 변환에 적용 되는 GraphicsPath 를 그리기 전에 합니다.The current transformation in the graphic context is applied to the GraphicsPath before it is drawn.

적용 대상