Graphics.DrawCurve メソッド (Pen, PointF[], Single)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Graphics Dim pen As Pen Dim points As PointF() Dim tension As Single instance.DrawCurve(pen, points, tension)


このメソッドは、配列の各点を通過するカーディナル スプラインを描画します。
点の配列には、描画する曲線の 3 つ以上の PointF 構造体を含める必要があります。
tension パラメータは、スプラインの形を決定します。tension パラメータの値が 0.0F の場合、このメソッドは点をつなぐ直線セグメントを描画します。通常、tension パラメータは 1.0F 以下です。値が 1.0F を超える場合は、予期しない結果になります。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawCurve メソッド (Pen, Point[], Single)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Graphics Dim pen As Pen Dim points As Point() Dim tension As Single instance.DrawCurve(pen, points, tension)


このメソッドは、配列の各点を通過するカーディナル スプラインを描画します。
点の配列には、描画する曲線の 3 つ以上の Point 構造体を含める必要があります。
tension パラメータは、スプラインの形を決定します。tension パラメータの値が 0.0F の場合、このメソッドは点をつなぐ直線セグメントを描画します。通常、tension パラメータは 1.0F 以下です。値が 1.0F を超える場合は、予期しない結果になります。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawCurve メソッド (Pen, Point[])
アセンブリ: System.Drawing (system.drawing.dll 内)




次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
このメソッドは、既定のテンションである 0.5 を使用します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawCurve メソッド (Pen, PointF[], Int32, Int32)
アセンブリ: System.Drawing (system.drawing.dll 内)

Public Sub DrawCurve ( _ pen As Pen, _ points As PointF(), _ offset As Integer, _ numberOfSegments As Integer _ )
Dim instance As Graphics Dim pen As Pen Dim points As PointF() Dim offset As Integer Dim numberOfSegments As Integer instance.DrawCurve(pen, points, offset, numberOfSegments)


このメソッドは、配列の各点を通過するカーディナル スプラインを描画します。
点の配列には、描画する曲線の 3 つ以上の PointF 構造体を含める必要があります。
offset でスキップする要素数が指定されます。スキップされた要素以降の最初の要素は、曲線の開始点を表します。
numberOfSegments パラメータの値では、曲線を描画するための開始点以降のセグメント数が指定されます。numberOfSegments パラメータの値は 1 以上にしてください。offset パラメータの値と numberOfSegments パラメータの値の合計は、points パラメータの配列内の要素数よりも小さい必要があります。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
このメソッドは、既定のテンションである 0.5 を使用します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawCurve メソッド (Pen, Point[], Int32, Int32, Single)
アセンブリ: System.Drawing (system.drawing.dll 内)

Public Sub DrawCurve ( _ pen As Pen, _ points As Point(), _ offset As Integer, _ numberOfSegments As Integer, _ tension As Single _ )
Dim instance As Graphics Dim pen As Pen Dim points As Point() Dim offset As Integer Dim numberOfSegments As Integer Dim tension As Single instance.DrawCurve(pen, points, offset, numberOfSegments, tension)
public: void DrawCurve ( Pen^ pen, array<Point>^ points, int offset, int numberOfSegments, float tension )
public function DrawCurve ( pen : Pen, points : Point[], offset : int, numberOfSegments : int, tension : float )


このメソッドは、配列の各点を通過するカーディナル スプラインを描画します。
点の配列には、描画する曲線の 3 つ以上の Point 構造体を含める必要があります。
offset でスキップする要素数が指定されます。スキップされた要素以降の最初の要素は、曲線の開始点を表します。
numberOfSegments パラメータの値では、曲線を描画するための開始点以降のセグメント数が指定されます。numberOfSegments パラメータの値は 1 以上にしてください。offset パラメータの値と numberOfSegments パラメータの値の合計は、points パラメータの配列内の要素数よりも小さい必要があります。
tension パラメータは、スプラインの形を決定します。tension パラメータの値が 0.0F の場合、このメソッドは点をつなぐ直線セグメントを描画します。通常、tension パラメータは 1.0F 以下です。値が 1.0F を超える場合は、予期しない結果になります。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawCurve メソッド

名前 | 説明 |
---|---|
Graphics.DrawCurve (Pen, Point[]) | 指定した Point 構造体の配列を通過するカーディナル スプラインを描画します。 |
Graphics.DrawCurve (Pen, PointF[]) | 指定した PointF 構造体の配列を通過するカーディナル スプラインを描画します。 |
Graphics.DrawCurve (Pen, Point[], Single) | 指定したテンションを使用して、指定した Point 構造体の配列を通過するカーディナル スプラインを描画します。 |
Graphics.DrawCurve (Pen, PointF[], Single) | 指定したテンションを使用して、指定した PointF 構造体の配列を通過するカーディナル スプラインを描画します。 |
Graphics.DrawCurve (Pen, PointF[], Int32, Int32) | 指定した PointF 構造体の配列を通過するカーディナル スプラインを描画します。この描画は、配列の先頭からのオフセットから開始されます。 |
Graphics.DrawCurve (Pen, Point[], Int32, Int32, Single) | 指定したテンションを使用して、指定した Point 構造体の配列を通過するカーディナル スプラインを描画します。 |
Graphics.DrawCurve (Pen, PointF[], Int32, Int32, Single) | 指定したテンションを使用して、指定した PointF 構造体の配列を通過するカーディナル スプラインを描画します。この描画は、配列の先頭からのオフセットから開始されます。 |

Graphics.DrawCurve メソッド (Pen, PointF[])
アセンブリ: System.Drawing (system.drawing.dll 内)




次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
このメソッドは、既定のテンションである 0.5 を使用します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawCurve メソッド (Pen, PointF[], Int32, Int32, Single)
アセンブリ: System.Drawing (system.drawing.dll 内)

Public Sub DrawCurve ( _ pen As Pen, _ points As PointF(), _ offset As Integer, _ numberOfSegments As Integer, _ tension As Single _ )
Dim instance As Graphics Dim pen As Pen Dim points As PointF() Dim offset As Integer Dim numberOfSegments As Integer Dim tension As Single instance.DrawCurve(pen, points, offset, numberOfSegments, tension)
public: void DrawCurve ( Pen^ pen, array<PointF>^ points, int offset, int numberOfSegments, float tension )
public function DrawCurve ( pen : Pen, points : PointF[], offset : int, numberOfSegments : int, tension : float )


このメソッドは、配列の各点を通過するカーディナル スプラインを描画します。
点の配列には、描画する曲線の 3 つ以上の PointF 構造体を含める必要があります。
offset でスキップする要素数が指定されます。スキップされた要素以降の最初の要素は、曲線の開始点を表します。
numberOfSegments パラメータの値では、曲線を描画するための開始点以降のセグメント数が指定されます。numberOfSegments パラメータの値は 1 以上にしてください。offset パラメータの値と numberOfSegments パラメータの値の合計は、points パラメータの配列内の要素数よりも小さい必要があります。
tension パラメータは、スプラインの形を決定します。tension パラメータの値が 0.0F の場合、このメソッドは点をつなぐ直線セグメントを描画します。通常、tension パラメータは 1.0F 以下です。値が 1.0F を超える場合は、予期しない結果になります。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public 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
public 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); }
public: 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 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGraphics.DrawCurveを検索する場合は、下記のリンクをクリックしてください。

- Graphics.DrawCurveのページへのリンク