次の方法で共有


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)

ソース:
Graphics.cs
ソース:
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)

ソース:
Graphics.cs
ソース:
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)

ソース:
Graphics.cs
ソース:
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)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 以上の値。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 赤と緑のペンを作成します。

  • 曲線を定義する 7 つの点を作成します。

  • 7 つの点の間に 6 本の赤い直線を描画して、不完全な多角形を形成します。

  • 始点オフセットとセグメント数を定義します。

  • テンションを定義します。

  • 最後の 5 つのポイントを通って、(3 番目の点から始まる) 開いた緑色の曲線を描画します。

このメソッドは、テンションを 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)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 以上の値。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 赤と緑のペンを作成します。

  • 曲線を定義する 7 つの点を作成します。

  • 7 つの点の間に 6 本の赤い直線を描画して、不完全な多角形を形成します。

  • 始点オフセットとセグメント数を定義します。

  • テンションを定義します。

  • 最後の 5 つのポイントを通って、(3 番目の点から始まる) 開いた緑色の曲線を描画します。

このメソッドは、テンションを 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

注釈

このメソッドは、配列内の各ポイントを通過するカーディナル スプラインを描画します。

曲線を描画するには、ポイントの配列に少なくとも 3 つの Point 構造体が含まれている必要があります。

offset パラメーターの値は、配列内でスキップする要素の数を指定します。 スキップされた要素の後の最初の要素は、曲線の始点を表します。

numberOfSegments パラメーターの値は、曲線に描画する始点の後のセグメント数を指定します。 numberOfSegments パラメーターの値は少なくとも 1 である必要があります。 offset パラメーターの値に numberOfSegments パラメーターの値を加えた値は、points パラメーターの配列内の要素数より小さくする必要があります。

tension パラメータは、スプラインの形状を決定します。 tension パラメーターの値が 0.0F の場合、このメソッドは直線セグメントを描画して点を接続します。 通常、tension パラメーターは 1.0F 以下です。 1.0F を超える値では、通常とは異なる結果が生成されます。

適用対象

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

ソース:
Graphics.cs
ソース:
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)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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

曲線に含める始点の後のセグメントの数。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 赤と緑のペンを作成します。

  • 曲線を定義する 7 つの点を作成します。

  • 7 つの点の間に 6 本の赤い直線を描画して、不完全な多角形を形成します。

  • 始点オフセットとセグメント数を定義します。

  • 最後の 5 つのポイントを通って、(3 番目の点から始まる) 開いた緑色の曲線を描画します。

このメソッドでは、既定のテンション値 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

注釈

このメソッドは、配列内の各ポイントを通過するカーディナル スプラインを描画します。

曲線を描画するには、ポイントの配列に少なくとも 3 つの PointF 構造体が含まれている必要があります。

offset パラメーターの値は、配列内でスキップする要素の数を指定します。 スキップされた要素の後の最初の要素は、曲線の始点を表します。

numberOfSegments パラメーターの値は、曲線に描画する始点の後のセグメント数を指定します。 numberOfSegments パラメーターの値は少なくとも 1 である必要があります。 offset パラメーターの値に numberOfSegments パラメーターの値を加えた値は、points パラメーターの配列内の要素数より小さくする必要があります。

この方法では、既定のテンション値 0.5 が使用されます。

適用対象

DrawCurve(Pen, PointF[], Single)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 以上の値。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、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

注釈

このメソッドは、配列内の各ポイントを通過するカーディナル スプラインを描画します。

曲線を描画するには、ポイントの配列に少なくとも 3 つの PointF 構造体が含まれている必要があります。

tension パラメータは、スプラインの形状を決定します。 tension パラメーターの値が 0.0F の場合、このメソッドは直線セグメントを描画して点を接続します。 通常、tension パラメーターは 1.0F 以下です。 1.0F を超える値では、通常とは異なる結果が生成されます。

適用対象

DrawCurve(Pen, Point[], Single)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 以上の値。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、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

注釈

このメソッドは、配列内の各ポイントを通過するカーディナル スプラインを描画します。

曲線を描画するには、ポイントの配列に少なくとも 3 つの Point 構造体が含まれている必要があります。

tension パラメータは、スプラインの形状を決定します。 tension パラメーターの値が 0.0F の場合、このメソッドは直線セグメントを描画して点を接続します。 通常、tension パラメーターは 1.0F 以下です。 1.0F を超える値では、通常とは異なる結果が生成されます。

適用対象

DrawCurve(Pen, ReadOnlySpan<PointF>)

ソース:
Graphics.cs
ソース:
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>)

ソース:
Graphics.cs
ソース:
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[])

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 構造体の配列。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、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

注釈

このメソッドは、配列内の各ポイントを通過するカーディナル スプラインを描画します。

曲線を描画するには、ポイントの配列に少なくとも 3 つの PointF 構造体が含まれている必要があります。

この方法では、既定のテンション値 0.5 が使用されます。

適用対象

DrawCurve(Pen, Point[])

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 構造体の配列。

例外

pennullです。

-又は-

pointsnullです。

次のコード例は Windows フォームで使用できるように設計されており、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

注釈

このメソッドは、配列内の各ポイントを通過するカーディナル スプラインを描画します。

曲線を描画するには、ポイントの配列に少なくとも 3 つの Point 構造体が含まれている必要があります。

この方法では、既定のテンション値 0.5 が使用されます。

適用対象

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

ソース:
Graphics.cs
ソース:
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

適用対象