Graphics.DrawCurve 메서드

정의

Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

오버로드

DrawCurve(Pen, ReadOnlySpan<PointF>, Single)
DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32, Single)
DrawCurve(Pen, ReadOnlySpan<Point>, Int32, Int32, Single)
DrawCurve(Pen, PointF[], Int32, Int32, Single)

지정된 장력을 사용하여 PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다. 그리기는 배열의 시작에서 오프셋을 시작합니다.

DrawCurve(Pen, Point[], Int32, Int32, Single)

지정된 장력을 사용하여 Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32)
DrawCurve(Pen, PointF[], Int32, Int32)

PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다. 그리기는 배열의 시작에서 오프셋을 시작합니다.

DrawCurve(Pen, PointF[], Single)

지정된 장력을 사용하여 PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

DrawCurve(Pen, Point[], Single)

지정된 장력을 사용하여 Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

DrawCurve(Pen, ReadOnlySpan<PointF>)
DrawCurve(Pen, ReadOnlySpan<Point>)
DrawCurve(Pen, PointF[])

PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

DrawCurve(Pen, Point[])

Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

DrawCurve(Pen, ReadOnlySpan<PointF>, Single)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points, float tension);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF), tension As Single)

매개 변수

pen
Pen
tension
Single

적용 대상

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32, Single)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points, int offset, int numberOfSegments, float tension);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF), offset As Integer, numberOfSegments As Integer, tension As Single)

매개 변수

pen
Pen
offset
Int32
numberOfSegments
Int32
tension
Single

적용 대상

DrawCurve(Pen, ReadOnlySpan<Point>, Int32, Int32, Single)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points, int offset, int numberOfSegments, float tension);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.Point> points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of Point), offset As Integer, numberOfSegments As Integer, tension As Single)

매개 변수

pen
Pen
offset
Int32
numberOfSegments
Int32
tension
Single

적용 대상

DrawCurve(Pen, PointF[], Int32, Int32, Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

지정된 장력을 사용하여 PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다. 그리기는 배열의 시작에서 오프셋을 시작합니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points, int offset, int numberOfSegments, float tension);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As PointF(), offset As Integer, numberOfSegments As Integer, tension As Single)

매개 변수

pen
Pen

곡선의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
PointF[]

스플라인을 정의하는 PointF 구조체의 배열입니다.

offset
Int32

points 매개 변수 배열의 첫째 요소에서 곡선의 시작점까지의 오프셋입니다.

numberOfSegments
Int32

시작점 다음부터 곡선에 포함될 세그먼트의 수입니다.

tension
Single

곡선의 장력을 지정하는 0.0F 보다 크거나 같은 값입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 시작점 오프셋 및 세그먼트 수를 정의합니다.

  • 장력을 정의합니다.

  • 마지막 5점을 통해 열린 녹색 곡선(세 번째 지점에서 시작)을 그립니다.

메서드는 장력을 1.0으로 설정합니다.

private:
   void DrawCurvePointFSegmentTension( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create offset, number of segments, and tension.
      int offset = 2;
      int numSegments = 4;
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, offset, numSegments, tension );
   }
private void DrawCurvePointFSegmentTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create offset, number of segments, and tension.
    int offset = 2;
    int numSegments = 4;
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);
}
Private Sub DrawCurvePointFSegmentTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create offset, number of segments, and tension.
    Dim offset As Integer = 2
    Dim numSegments As Integer = 4
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, _
    tension)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 구조체를 3개 PointF 이상 포함해야 합니다.

매개 변수의 offset 값은 배열에서 건너뛸 요소 수를 지정합니다. 건너뛴 요소 뒤의 첫 번째 요소는 곡선의 시작점을 나타냅니다.

매개 변수의 numberOfSegments 값은 곡선에 그릴 시작점 뒤의 세그먼트 수를 지정합니다. 매개 변수의 값은 numberOfSegments 1 이상이어야 합니다. 매개 변수 값과 offset 매개 변수 값은 numberOfSegments 매개 변수 배열 points 의 요소 수보다 작아야 합니다.

매개 변수는 tension 스플라인의 모양을 결정합니다. 매개 변수 값 tension 이 0.0F이면 이 메서드는 직선 세그먼트를 그려 지점을 연결합니다. 일반적으로 tension 매개 변수는 1.0F보다 작거나 같습니다. 1.0F를 넘는 값은 비정상적인 결과를 생성합니다.

적용 대상

DrawCurve(Pen, Point[], Int32, Int32, Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

지정된 장력을 사용하여 Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points, int offset, int numberOfSegments, float tension);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.Point[] points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.Point[] * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As Point(), offset As Integer, numberOfSegments As Integer, tension As Single)

매개 변수

pen
Pen

곡선의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
Point[]

스플라인을 정의하는 Point 구조체의 배열입니다.

offset
Int32

points 매개 변수 배열의 첫째 요소에서 곡선의 시작점까지의 오프셋입니다.

numberOfSegments
Int32

시작점 다음부터 곡선에 포함될 세그먼트의 수입니다.

tension
Single

곡선의 장력을 지정하는 0.0F 보다 크거나 같은 값입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 시작점 오프셋 및 세그먼트 수를 정의합니다.

  • 장력을 정의합니다.

  • 마지막 5점을 통해 열린 녹색 곡선(세 번째 지점에서 시작)을 그립니다.

메서드는 장력을 1.0으로 설정합니다.

private:
   void DrawCurvePointSegmentTension( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create offset, number of segments, and tension.
      int offset = 2;
      int numSegments = 4;
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, offset, numSegments, tension );
   }
private void DrawCurvePointSegmentTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create offset, number of segments, and tension.
    int offset = 2;
    int numSegments = 4;
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);
}
Private Sub DrawCurvePointSegmentTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create offset, number of segments, and tension.
    Dim offset As Integer = 2
    Dim numSegments As Integer = 4
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, _
    tension)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 세 Point 개 이상의 구조체를 포함해야 합니다.

매개 변수의 offset 값은 배열에서 건너뛸 요소 수를 지정합니다. 건너뛴 요소 뒤의 첫 번째 요소는 곡선의 시작점을 나타냅니다.

매개 변수의 numberOfSegments 값은 곡선에 그릴 시작점 뒤의 세그먼트 수를 지정합니다. 매개 변수의 값은 numberOfSegments 1 이상이어야 합니다. 매개 변수 값과 offset 매개 변수 값은 numberOfSegments 매개 변수 배열 points 의 요소 수보다 작아야 합니다.

매개 변수는 tension 스플라인의 모양을 결정합니다. 매개 변수 값 tension 이 0.0F이면 이 메서드는 직선 세그먼트를 그려 지점을 연결합니다. 일반적으로 tension 매개 변수는 1.0F보다 작거나 같습니다. 1.0F를 넘는 값은 비정상적인 결과를 생성합니다.

적용 대상

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points, int offset, int numberOfSegments);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points, int offset, int numberOfSegments);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> * int * int -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF), offset As Integer, numberOfSegments As Integer)

매개 변수

pen
Pen
offset
Int32
numberOfSegments
Int32

적용 대상

DrawCurve(Pen, PointF[], Int32, Int32)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다. 그리기는 배열의 시작에서 오프셋을 시작합니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points, int offset, int numberOfSegments);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] * int * int -> unit
Public Sub DrawCurve (pen As Pen, points As PointF(), offset As Integer, numberOfSegments As Integer)

매개 변수

pen
Pen

곡선의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
PointF[]

스플라인을 정의하는 PointF 구조체의 배열입니다.

offset
Int32

points 매개 변수 배열의 첫째 요소에서 곡선의 시작점까지의 오프셋입니다.

numberOfSegments
Int32

시작점 다음부터 곡선에 포함될 세그먼트의 수입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 시작점 오프셋 및 세그먼트 수를 정의합니다.

  • 마지막 5점을 통해 열린 녹색 곡선(세 번째 지점에서 시작)을 그립니다.

메서드는 기본 장력 0.5를 사용합니다.

private:
   void DrawCurvePointFSegments( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create offset and number of segments.
      int offset = 2;
      int numSegments = 4;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, offset, numSegments );
   }
private void DrawCurvePointFSegments(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create offset and number of segments.
    int offset = 2;
    int numSegments = 4;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments);
}
Private Sub DrawCurvePointFSegments(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create offset and number of segments.
    Dim offset As Integer = 2
    Dim numSegments As Integer = 4

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 세 PointF 개 이상의 구조체를 포함해야 합니다.

매개 변수의 offset 값은 배열에서 건너뛸 요소 수를 지정합니다. 건너뛴 요소 뒤의 첫 번째 요소는 곡선의 시작점을 나타냅니다.

매개 변수의 numberOfSegments 값은 곡선에 그릴 시작점 뒤의 세그먼트 수를 지정합니다. 매개 변수의 값은 numberOfSegments 1 이상이어야 합니다. 매개 변수 값과 offset 매개 변수 값은 numberOfSegments 매개 변수 배열 points 의 요소 수보다 작아야 합니다.

이 메서드는 기본 장력 0.5를 사용합니다.

적용 대상

DrawCurve(Pen, PointF[], Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

지정된 장력을 사용하여 PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points, float tension);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] * single -> unit
Public Sub DrawCurve (pen As Pen, points As PointF(), tension As Single)

매개 변수

pen
Pen

곡선의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
PointF[]

곡선을 정의하는 점을 나타내는 PointF 구조체의 배열입니다.

tension
Single

곡선의 장력을 지정하는 0.0F 보다 크거나 같은 값입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 장력 설정을 만듭니다.

  • 7포인트를 통해 열린 녹색 닫힌 곡선을 그립니다.

메서드는 1.0의 장력을 사용합니다.

private:
   void DrawCurvePointFTension( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create tension.
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, tension );
   }
private void DrawCurvePointFTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create tension.
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension);
}
Private Sub DrawCurvePointFTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create tension.
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 세 PointF 개 이상의 구조체를 포함해야 합니다.

매개 변수는 tension 스플라인의 모양을 결정합니다. 매개 변수 값 tension 이 0.0F이면 이 메서드는 직선 세그먼트를 그려 지점을 연결합니다. 일반적으로 tension 매개 변수는 1.0F보다 작거나 같습니다. 1.0F를 넘는 값은 비정상적인 결과를 생성합니다.

적용 대상

DrawCurve(Pen, Point[], Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

지정된 장력을 사용하여 Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points, float tension);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.Point[] points, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.Point[] * single -> unit
Public Sub DrawCurve (pen As Pen, points As Point(), tension As Single)

매개 변수

pen
Pen

곡선의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
Point[]

스플라인을 정의하는 Point 구조체의 배열입니다.

tension
Single

곡선의 장력을 지정하는 0.0F 보다 크거나 같은 값입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 장력 설정을 만듭니다.

  • 7포인트를 통해 열린 녹색 닫힌 곡선을 그립니다.

메서드는 1.0의 장력을 사용합니다.

private:
   void DrawCurvePointTension( PaintEventArgs^ e )
   {

      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create tension.
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, tension );
   }
private void DrawCurvePointTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create tension.
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension);
}
Private Sub DrawCurvePointTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create tension.
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 세 Point 개 이상의 구조체를 포함해야 합니다.

매개 변수는 tension 스플라인의 모양을 결정합니다. 매개 변수 값 tension 이 0.0F이면 이 메서드는 직선 세그먼트를 그려 지점을 연결합니다. 일반적으로 tension 매개 변수는 1.0F보다 작거나 같습니다. 1.0F를 넘는 값은 비정상적인 결과를 생성합니다.

적용 대상

DrawCurve(Pen, ReadOnlySpan<PointF>)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF))

매개 변수

pen
Pen

적용 대상

DrawCurve(Pen, ReadOnlySpan<Point>)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.Point> points);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of Point))

매개 변수

pen
Pen

적용 대상

DrawCurve(Pen, PointF[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

PointF 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points);
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ... cli::array <System::Drawing::PointF> ^ points);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.PointF[] points);
public void DrawCurve (System.Drawing.Pen pen, params System.Drawing.PointF[] points);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] -> unit
Public Sub DrawCurve (pen As Pen, points As PointF())
Public Sub DrawCurve (pen As Pen, ParamArray points As PointF())

매개 변수

pen
Pen

곡선의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
PointF[]

스플라인을 정의하는 PointF 구조체의 배열입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 7포인트를 통해 열린 녹색 곡선을 그립니다.

메서드는 기본 장력 0.5를 사용합니다.

private:
   void DrawCurvePointF( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints );
   }
private void DrawCurvePointF(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints);
}
Private Sub DrawCurvePointF(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 세 PointF 개 이상의 구조체를 포함해야 합니다.

이 메서드는 기본 장력 0.5를 사용합니다.

적용 대상

DrawCurve(Pen, Point[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Point 구조체의 지정된 배열을 따라 카디널 스플라인을 그립니다.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points);
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ... cli::array <System::Drawing::Point> ^ points);
public void DrawCurve (System.Drawing.Pen pen, System.Drawing.Point[] points);
public void DrawCurve (System.Drawing.Pen pen, params System.Drawing.Point[] points);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.Point[] -> unit
Public Sub DrawCurve (pen As Pen, points As Point())
Public Sub DrawCurve (pen As Pen, ParamArray points As Point())

매개 변수

pen
Pen

곡선의 색, 너비 및 높이를 결정하는 Pen입니다.

points
Point[]

스플라인을 정의하는 Point 구조체의 배열입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

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

  • 빨간색 및 녹색 펜을 만듭니다.

  • 곡선을 정의하는 7개의 점을 만듭니다.

  • 7개 점 사이에 6개의 빨간색 직선을 그려 불완전한 다각형을 형성합니다.

  • 7포인트를 통해 열린 녹색 곡선을 그립니다.

메서드는 기본 장력 0.5를 사용합니다.

private:
   void DrawCurvePoint( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints );
   }
private void DrawCurvePoint(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints);
}
Private Sub DrawCurvePoint(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints)
End Sub

설명

이 메서드는 배열의 각 지점을 통과하는 카디널 스플라인을 그립니다.

점 배열은 곡선을 그릴 세 Point 개 이상의 구조체를 포함해야 합니다.

이 메서드는 기본 장력 0.5를 사용합니다.

적용 대상

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

Source:
Graphics.cs
public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points, float tension);
public void DrawCurve (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.Point> points, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of Point), tension As Single)

매개 변수

pen
Pen
tension
Single

적용 대상