Graphics.DrawCurve Méthode

Définition

Dessine une spline cardinale via un tableau de structures Point spécifié.

Surcharges

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)

Dessine une spline cardinale via un tableau de structures PointF spécifié avec une tension indiquée. Le dessin commence l'offset au début du tableau.

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

Dessine une spline cardinale via un tableau de structures Point spécifié avec une tension indiquée.

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

Dessine une spline cardinale via un tableau de structures PointF spécifié. Le dessin commence l'offset au début du tableau.

DrawCurve(Pen, PointF[], Single)

Dessine une spline cardinale via un tableau de structures PointF spécifié avec une tension indiquée.

DrawCurve(Pen, Point[], Single)

Dessine une spline cardinale via un tableau de structures Point spécifié avec une tension indiquée.

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

Dessine une spline cardinale via un tableau de structures PointF spécifié.

DrawCurve(Pen, Point[])

Dessine une spline cardinale via un tableau de structures Point spécifié.

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)

Paramètres

pen
Pen
tension
Single

S’applique à

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)

Paramètres

pen
Pen
offset
Int32
numberOfSegments
Int32
tension
Single

S’applique à

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)

Paramètres

pen
Pen
offset
Int32
numberOfSegments
Int32
tension
Single

S’applique à

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

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

Dessine une spline cardinale via un tableau de structures PointF spécifié avec une tension indiquée. Le dessin commence l'offset au début du tableau.

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)

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et le style de la courbe.

points
PointF[]

Tableau de structures PointF qui définissent la spline.

offset
Int32

Offset à partir du premier élément figurant dans le tableau du paramètre points jusqu'au point de départ de la courbe.

numberOfSegments
Int32

Nombre de segments situés après le point de départ à inclure dans la courbe.

tension
Single

Valeur supérieure ou égale à 0,0 F qui spécifie la tension de la courbe.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir une courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Définit le décalage du point de départ et le nombre de segments.

  • Définit la tension.

  • Dessine une courbe verte ouverte (en commençant au troisième point) jusqu’aux cinq derniers points.

La méthode définit la tension sur 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois PointF structures pour que la courbe soit dessinée.

La valeur du offset paramètre spécifie le nombre d’éléments à ignorer dans le tableau. Le premier élément après les éléments ignorés représente le point de départ de la courbe.

La valeur du numberOfSegments paramètre spécifie le nombre de segments, après le point de départ, à dessiner dans la courbe. La valeur du numberOfSegments paramètre doit être au moins 1. La valeur du offset paramètre plus la valeur du numberOfSegments paramètre doit être inférieure au nombre d’éléments dans le tableau du points paramètre.

Le tension paramètre détermine la forme de la spline. Si la valeur du tension paramètre est 0,0F, cette méthode dessine des segments de ligne droite pour connecter les points. Généralement, le tension paramètre est inférieur ou égal à 1.0F. Les valeurs supérieures à 1,0F produisent des résultats inhabituels.

S’applique à

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

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

Dessine une spline cardinale via un tableau de structures Point spécifié avec une tension indiquée.

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)

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et le style de la courbe.

points
Point[]

Tableau de structures Point qui définissent la spline.

offset
Int32

Offset à partir du premier élément figurant dans le tableau du paramètre points jusqu'au point de départ de la courbe.

numberOfSegments
Int32

Nombre de segments situés après le point de départ à inclure dans la courbe.

tension
Single

Valeur supérieure ou égale à 0,0 F qui spécifie la tension de la courbe.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir une courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Définit le décalage du point de départ et le nombre de segments.

  • Définit la tension.

  • Dessine une courbe verte ouverte (en commençant au troisième point) jusqu’aux cinq derniers points.

La méthode définit la tension sur 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois Point structures pour qu’une courbe soit dessinée.

La valeur du offset paramètre spécifie le nombre d’éléments à ignorer dans le tableau. Le premier élément après les éléments ignorés représente le point de départ de la courbe.

La valeur du numberOfSegments paramètre spécifie le nombre de segments, après le point de départ, à dessiner dans la courbe. La valeur du numberOfSegments paramètre doit être au moins 1. La valeur du offset paramètre plus la valeur du numberOfSegments paramètre doit être inférieure au nombre d’éléments dans le tableau du points paramètre.

Le tension paramètre détermine la forme de la spline. Si la valeur du tension paramètre est 0,0F, cette méthode dessine des segments de ligne droite pour connecter les points. Généralement, le tension paramètre est inférieur ou égal à 1.0F. Les valeurs supérieures à 1,0F produisent des résultats inhabituels.

S’applique à

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)

Paramètres

pen
Pen
offset
Int32
numberOfSegments
Int32

S’applique à

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

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

Dessine une spline cardinale via un tableau de structures PointF spécifié. Le dessin commence l'offset au début du tableau.

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)

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et le style de la courbe.

points
PointF[]

Tableau de structures PointF qui définissent la spline.

offset
Int32

Offset à partir du premier élément figurant dans le tableau du paramètre points jusqu'au point de départ de la courbe.

numberOfSegments
Int32

Nombre de segments situés après le point de départ à inclure dans la courbe.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir une courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Définit le décalage du point de départ et le nombre de segments.

  • Dessine une courbe verte ouverte (en commençant au troisième point) jusqu’aux cinq derniers points.

La méthode utilise une tension par défaut de 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois PointF structures pour qu’une courbe soit dessinée.

La valeur du offset paramètre spécifie le nombre d’éléments à ignorer dans le tableau. Le premier élément après les éléments ignorés représente le point de départ de la courbe.

La valeur du numberOfSegments paramètre spécifie le nombre de segments, après le point de départ, à dessiner dans la courbe. La valeur du numberOfSegments paramètre doit être au moins 1. La valeur du offset paramètre plus la valeur du numberOfSegments paramètre doit être inférieure au nombre d’éléments dans le tableau du points paramètre.

Cette méthode utilise une tension par défaut de 0,5.

S’applique à

DrawCurve(Pen, PointF[], Single)

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

Dessine une spline cardinale via un tableau de structures PointF spécifié avec une tension indiquée.

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)

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et le style de la courbe.

points
PointF[]

Tableau de structures PointF qui représentent les points qui définissent la courbe.

tension
Single

Valeur supérieure ou égale à 0,0 F qui spécifie la tension de la courbe.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir la courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Crée un paramètre de tension.

  • Dessine une courbe fermée verte ouverte à travers les sept points.

La méthode utilise une tension de 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois PointF structures pour qu’une courbe soit dessinée.

Le tension paramètre détermine la forme de la spline. Si la valeur du tension paramètre est 0,0F, cette méthode dessine des segments de ligne droite pour connecter les points. En règle générale, le tension paramètre est inférieur ou égal à 1,0F. Les valeurs supérieures à 1,0 F produisent des résultats inhabituels.

S’applique à

DrawCurve(Pen, Point[], Single)

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

Dessine une spline cardinale via un tableau de structures Point spécifié avec une tension indiquée.

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)

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et le style de la courbe.

points
Point[]

Tableau de structures Point qui définissent la spline.

tension
Single

Valeur supérieure ou égale à 0,0 F qui spécifie la tension de la courbe.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir la courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Crée un paramètre de tension.

  • Dessine une courbe fermée verte ouverte à travers les sept points.

La méthode utilise une tension de 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois Point structures pour qu’une courbe soit dessinée.

Le tension paramètre détermine la forme de la spline. Si la valeur du tension paramètre est 0,0F, cette méthode dessine des segments de ligne droite pour connecter les points. En règle générale, le tension paramètre est inférieur ou égal à 1,0F. Les valeurs supérieures à 1,0 F produisent des résultats inhabituels.

S’applique à

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))

Paramètres

pen
Pen

S’applique à

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))

Paramètres

pen
Pen

S’applique à

DrawCurve(Pen, PointF[])

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

Dessine une spline cardinale via un tableau de structures PointF spécifié.

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())

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et le style de la courbe.

points
PointF[]

Tableau de structures PointF qui définissent la spline.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir une courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Dessine une courbe verte ouverte à travers les sept points.

La méthode utilise une tension par défaut de 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois PointF structures pour qu’une courbe soit dessinée.

Cette méthode utilise une tension par défaut de 0,5.

S’applique à

DrawCurve(Pen, Point[])

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

Dessine une spline cardinale via un tableau de structures Point spécifié.

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())

Paramètres

pen
Pen

Pen qui détermine la couleur, la largeur et la hauteur de la courbe.

points
Point[]

Tableau de structures Point qui définissent la spline.

Exceptions

pen a la valeur null.

-ou-

points a la valeur null.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée des stylos rouges et verts.

  • Crée sept points pour définir une courbe.

  • Dessine six lignes droites rouges entre les sept points pour former un polygone incomplet.

  • Dessine une courbe verte ouverte à travers les sept points.

La méthode utilise une tension par défaut de 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

Remarques

Cette méthode dessine une spline cardinale qui traverse chaque point du tableau.

Le tableau de points doit contenir au moins trois Point structures pour qu’une courbe soit dessinée.

Cette méthode utilise une tension par défaut de 0,5.

S’applique à

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)

Paramètres

pen
Pen
tension
Single

S’applique à