GraphicsPath.Widen 메서드

정의

이 경로를 지정된 펜으로 그릴 때 채워지는 영역을 둘러싸는 곡선으로 이 경로를 바꿉니다.

오버로드

Widen(Pen, Matrix)

GraphicsPath에 윤곽선을 추가합니다.

Widen(Pen)

경로에 윤곽선을 추가합니다.

Widen(Pen, Matrix, Single)

이 경로를 지정된 펜으로 그릴 때 채워지는 영역을 둘러싸는 곡선으로 이 GraphicsPath를 바꿉니다.

Widen(Pen, Matrix)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

GraphicsPath에 윤곽선을 추가합니다.

public:
 void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix -> unit
Public Sub Widen (pen As Pen, matrix As Matrix)

매개 변수

pen
Pen

경로의 원래 윤곽선과 이 메서드가 만든 새 윤곽선 사이의 너비를 지정하는 Pen입니다.

matrix
Matrix

너비를 넓히기 전에 경로에 적용할 변환을 지정하는 Matrix입니다.

예제

예제를 보려면 Widen(Pen, Matrix, Single)를 참조하세요.

설명

이 메서드는 기존 줄과 새 윤곽선 사이의 거리가 호출에 GraphicsPath사용된 Widen의 너비 Pen 와 동일한 원래 줄 주위에 윤곽선을 만듭니다. 줄 사이의 공간을 채우려면 를 DrawPath사용해야 FillPath 합니다.

적용 대상

Widen(Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

경로에 윤곽선을 추가합니다.

public:
 void Widen(System::Drawing::Pen ^ pen);
public void Widen (System.Drawing.Pen pen);
member this.Widen : System.Drawing.Pen -> unit
Public Sub Widen (pen As Pen)

매개 변수

pen
Pen

경로의 원래 윤곽선과 이 메서드가 만든 새 윤곽선 사이의 너비를 지정하는 Pen입니다.

예제

예제를 보려면 Widen(Pen, Matrix, Single)를 참조하세요.

설명

이 메서드는 기존 줄과 새 윤곽선 사이의 거리가 호출에 GraphicsPath사용된 Widen의 너비 Pen 와 동일한 원래 줄 주위에 윤곽선을 만듭니다. 줄 사이의 공간을 채우려면 를 DrawPath사용해야 FillPath 합니다.

적용 대상

Widen(Pen, Matrix, Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

이 경로를 지정된 펜으로 그릴 때 채워지는 영역을 둘러싸는 곡선으로 이 GraphicsPath를 바꿉니다.

public:
 void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix, float flatness);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix * single -> unit
Public Sub Widen (pen As Pen, matrix As Matrix, flatness As Single)

매개 변수

pen
Pen

경로의 원래 윤곽선과 이 메서드가 만든 새 윤곽선 사이의 너비를 지정하는 Pen입니다.

matrix
Matrix

너비를 넓히기 전에 경로에 적용할 변환을 지정하는 Matrix입니다.

flatness
Single

곡선에 대한 직선화 정도를 지정하는 값입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 개체인 가 OnPaint 필요합니다PaintEventArgse. 코드는 다음 작업을 수행합니다.

  • 경로를 만들고 경로에 두 줄임표를 추가합니다.

  • 경로를 검은색으로 그립니다.

  • 경로를 확장합니다.

  • 경로를 빨간색으로 그립니다.

두 번째 렌더링은 대신 DrawPath를 사용 FillPath 하므로 렌더링된 그림에 윤곽선이 채워져 있습니다.

private:
   void WidenExample( PaintEventArgs^ e )
   {
      // Create a path and add two ellipses.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( 0, 0, 100, 100 );
      myPath->AddEllipse( 100, 0, 100, 100 );

      // Draw the original ellipses to the screen in black.
      e->Graphics->DrawPath( Pens::Black, myPath );

      // Widen the path.
      Pen^ widenPen = gcnew Pen( Color::Black,10.0f );
      Matrix^ widenMatrix = gcnew Matrix;
      widenMatrix->Translate( 50, 50 );
      myPath->Widen( widenPen, widenMatrix, 1.0f );

      // Draw the widened path to the screen in red.
      e->Graphics->FillPath( gcnew SolidBrush( Color::Red ), myPath );
   }
private void WidenExample(PaintEventArgs e)
{
             
    // Create a path and add two ellipses.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(0, 0, 100, 100);
    myPath.AddEllipse(100, 0, 100, 100);
             
    // Draw the original ellipses to the screen in black.
    e.Graphics.DrawPath(Pens.Black, myPath);
             
    // Widen the path.
    Pen widenPen = new Pen(Color.Black, 10);
    Matrix widenMatrix = new Matrix();
    widenMatrix.Translate(50, 50);
    myPath.Widen(widenPen, widenMatrix, 1.0f);
             
    // Draw the widened path to the screen in red.
    e.Graphics.FillPath(new SolidBrush(Color.Red), myPath);
}
Public Sub WidenExample(ByVal e As PaintEventArgs)
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(0, 0, 100, 100)
    myPath.AddEllipse(100, 0, 100, 100)
    e.Graphics.DrawPath(Pens.Black, myPath)
    Dim widenPen As New Pen(Color.Black, 10)
    Dim widenMatrix As New Matrix
    widenMatrix.Translate(50, 50)
    myPath.Widen(widenPen, widenMatrix, 1.0F)
    ' Sets tension for curves.
    e.Graphics.FillPath(New SolidBrush(Color.Red), myPath)
End Sub

설명

이 메서드는 기존 줄과 새 윤곽선 사이의 거리가 호출에 GraphicsPath사용된 Widen의 너비 Pen 와 동일한 원래 줄 주위에 윤곽선을 만듭니다. 줄 사이의 공간을 채우려면 를 DrawPath사용해야 FillPath 합니다.

적용 대상