영어로 읽기

다음을 통해 공유


GraphicsPath.Flatten 메서드

정의

이 경로의 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

오버로드

Flatten()

이 경로의 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

Flatten(Matrix)

지정된 변환을 적용한 다음 이 GraphicsPath 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

Flatten(Matrix, Single)

GraphicsPath 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

Flatten()

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

이 경로의 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

public void Flatten ();

예제

예제는 Flatten(Matrix, Single)참조하세요.

적용 대상

.NET 9 및 기타 버전
제품 버전
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Flatten(Matrix)

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

지정된 변환을 적용한 다음 이 GraphicsPath 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

public void Flatten (System.Drawing.Drawing2D.Matrix? matrix);
public void Flatten (System.Drawing.Drawing2D.Matrix matrix);

매개 변수

matrix
Matrix

평면화하기 전에 이 GraphicsPath 변환할 Matrix.

예제

예제는 Flatten(Matrix, Single)참조하세요.

적용 대상

.NET 9 및 기타 버전
제품 버전
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Flatten(Matrix, Single)

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

GraphicsPath 각 곡선을 연결된 선 세그먼트 시퀀스로 변환합니다.

public void Flatten (System.Drawing.Drawing2D.Matrix? matrix, float flatness);
public void Flatten (System.Drawing.Drawing2D.Matrix matrix, float flatness);

매개 변수

matrix
Matrix

평면화하기 전에 이 GraphicsPath 변환할 Matrix.

flatness
Single

곡선과 해당 평면화된 근사값 사이에 허용되는 최대 오차를 지정합니다. 값 0.25가 기본값입니다. 평탄도 값을 줄이면 근사값의 선 세그먼트 수가 증가합니다.

예제

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

  • 그래픽 경로 및 번역 행렬을 만듭니다.

  • 4포인트를 사용하여 경로에 곡선을 추가합니다.

  • 검은색 펜을 사용하여 화면에 경로(곡선)를 그립니다.

  • 곡선을 10픽셀 아래로 이동하고 평면화합니다.

  • 빨간색 펜을 사용하여 화면에 곡선을 그립니다.

빨간색 곡선에는 점을 연결하는 평면화된 선이 있습니다.

private void FlattenExample(PaintEventArgs e)
{
    GraphicsPath myPath = new GraphicsPath();
    Matrix translateMatrix = new Matrix();
    translateMatrix.Translate(0, 10);
    Point point1 = new Point(20, 100);
    Point point2 = new Point(70, 10);
    Point point3 = new Point(130, 200);
    Point point4 = new Point(180, 100);
    Point[] points = {point1, point2, point3, point4};
    myPath.AddCurve(points);
    e.Graphics.DrawPath(new Pen(Color.Black, 2), myPath);
    myPath.Flatten(translateMatrix, 10f);
    e.Graphics.DrawPath(new Pen(Color.Red, 1), myPath);
}

적용 대상

.NET 9 및 기타 버전
제품 버전
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9