다음을 통해 공유


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
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 너비와 같습니다. 줄 사이의 간격을 채우려면 FillPath 대신 DrawPath.

적용 대상

Widen(Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
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 너비와 같습니다. 줄 사이의 간격을 채우려면 FillPath 대신 DrawPath.

적용 대상

Widen(Pen, Matrix, Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
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 너비와 같습니다. 줄 사이의 간격을 채우려면 FillPath 대신 DrawPath.

적용 대상