## Definición

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure. Se utiliza una curva spline cardinal porque la curva recorre todos los puntos de la matriz.A cardinal spline curve is used because the curve travels through each of the points in the array.

## Sobrecargas

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure.

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

#### Parámetros

points
PointF[]

Matriz de estructuras PointF que representa los puntos que definen la curva.An array of PointF structures that represents the points that define the curve.

offset
Int32

Índice del elemento de la matriz `points` que se usa como primer punto de la curva.The index of the element in the `points` array that is used as the first point in the curve.

numberOfSegments
Int32

Número de segmentos usados para dibujar la curva.The number of segments used to draw the curve. Un segmento es, en realidad, una línea que conecta dos puntos.A segment can be thought of as a line connecting two points.

tension
Single

Valor que especifica la inclinación de la curva entre puntos de control.A value that specifies the amount that the curve bends between control points. Los valores mayores que 1 producen resultados impredecibles.Values greater than 1 produce unpredictable results.

### Ejemplos

Para obtener un ejemplo, vea AddCurve(Point[], Int32, Int32, Single).For an example, see AddCurve(Point[], Int32, Int32, Single).

### Comentarios

El usuario debe conservar los puntos originales si es necesario.The user must keep the original points if they are needed. Los puntos originales se convierten en puntos de control Bézier cúbicos internamente, por lo que no hay ningún mecanismo para devolver los puntos originales.The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.

La curva comienza en el punto de la matriz especificado por `offset`e incluye el número de puntos (segmentos) especificados por `numberOfSegments`.The curve begins at the point in the array specified by `offset`, and includes the number of points (segments) specified by `numberOfSegments`.

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure.

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

#### Parámetros

points
Point[]

Matriz de estructuras Point que representa los puntos que definen la curva.An array of Point structures that represents the points that define the curve.

offset
Int32

Índice del elemento de la matriz `points` que se usa como primer punto de la curva.The index of the element in the `points` array that is used as the first point in the curve.

numberOfSegments
Int32

Valor que especifica la inclinación de la curva entre puntos de control.A value that specifies the amount that the curve bends between control points. Los valores mayores que 1 producen resultados impredecibles.Values greater than 1 produce unpredictable results.

tension
Single

Valor que especifica la inclinación de la curva entre puntos de control.A value that specifies the amount that the curve bends between control points. Los valores mayores que 1 producen resultados impredecibles.Values greater than 1 produce unpredictable results.

### Ejemplos

El siguiente ejemplo de código está diseñado para su uso con Windows Forms y requiere PaintEventArgs`e`, un objeto de evento de OnPaint.The following code example is designed for use with Windows Forms, and it requires PaintEventArgs`e`, an OnPaint event object. El código realiza las siguientes acciones:The code performs the following actions:

• Crea una matriz de cuatro puntos (que representa una curva spline cardinal).Creates an array of four points (representing a cardinal spline).

• Crea una ruta de acceso y usa la matriz de puntos, agrega la curva a la ruta de acceso.Creates a path and using the array of points, adds the curve to the path.

• Dibuja la ruta de acceso a la pantalla.Draws the path to the screen.

Tenga en cuenta que mientras que la matriz contiene cuatro puntos, solo hay tres segmentos, que es el número especificado en el tercer argumento de la llamada a AddCurve.Notice that while the array holds four points, there are only three segments, which is the number specified in the third argument of the call to AddCurve.

``````private:
{
// Create some points.
Point point1 = Point(20,20);
Point point2 = Point(40,0);
Point point3 = Point(60,40);
Point point4 = Point(80,20);

// Create an array of the points.
array<Point>^ curvePoints = {point1,point2,point3,point4};

// Create a GraphicsPath object and add a curve.
GraphicsPath^ myPath = gcnew GraphicsPath;
myPath->AddCurve( curvePoints, 0, 3, 0.8f );

// Draw the path to the screen.
Pen^ myPen = gcnew Pen( Color::Black,2.0f );
e->Graphics->DrawPath( myPen, myPath );
}
``````
``````private void AddCurveExample(PaintEventArgs e)
{

// Create some points.
Point point1 = new Point(20, 20);
Point point2 = new Point(40, 0);
Point point3 = new Point(60, 40);
Point point4 = new Point(80, 20);

// Create an array of the points.
Point[] curvePoints = {point1, point2, point3, point4};

// Create a GraphicsPath object and add a curve.
GraphicsPath myPath = new GraphicsPath();

// Draw the path to the screen.
Pen myPen = new Pen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}
``````
``````Public Sub AddCurveExample(ByVal e As PaintEventArgs)

' Create some points.
Dim point1 As New Point(20, 20)
Dim point2 As New Point(40, 0)
Dim point3 As New Point(60, 40)
Dim point4 As New Point(80, 20)

' Create an array of the points.
Dim curvePoints As Point() = {point1, point2, point3, point4}

' Create a GraphicsPath object and add a curve.
Dim myPath As New GraphicsPath

' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub
``````

### Comentarios

El usuario debe conservar los puntos originales si es necesario.The user must keep the original points if they are needed. Los puntos originales se convierten en puntos de control Bézier cúbicos internamente, por lo que no hay ningún mecanismo para devolver los puntos originales.The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.

La curva comienza en el punto de la matriz especificado por el parámetro `offset` e incluye el número de puntos (segmentos) especificados por `numberOfSegments`.The curve begins at the point in the array specified by the `offset` parameter and includes the number of points (segments) specified by `numberOfSegments`.

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure.

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

#### Parámetros

points
PointF[]

Matriz de estructuras PointF que representa los puntos que definen la curva.An array of PointF structures that represents the points that define the curve.

tension
Single

Valor que especifica la inclinación de la curva entre puntos de control.A value that specifies the amount that the curve bends between control points. Los valores mayores que 1 producen resultados impredecibles.Values greater than 1 produce unpredictable results.

### Ejemplos

Para obtener un ejemplo, vea AddCurve(Point[], Int32, Int32, Single).For an example, see AddCurve(Point[], Int32, Int32, Single).

### Comentarios

El usuario debe conservar los puntos originales si es necesario.The user must keep the original points if they are needed. Los puntos originales se convierten en puntos de control Bézier cúbicos internamente, por lo que no hay ningún mecanismo para devolver los puntos originales.The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure. Se utiliza una curva spline cardinal porque la curva recorre todos los puntos de la matriz.A cardinal spline curve is used because the curve travels through each of the points in the array.

``````public:
``public void AddCurve (System.Drawing.PointF[] points);``
``member this.AddCurve : System.Drawing.PointF[] -> unit``
``Public Sub AddCurve (points As PointF())``

#### Parámetros

points
PointF[]

Matriz de estructuras PointF que representa los puntos que definen la curva.An array of PointF structures that represents the points that define the curve.

### Ejemplos

Para obtener un ejemplo, vea AddCurve(Point[], Int32, Int32, Single).For an example, see AddCurve(Point[], Int32, Int32, Single).

### Comentarios

El usuario debe conservar los puntos originales si es necesario.The user must keep the original points if they are needed. Los puntos originales se convierten en puntos de control Bézier cúbicos internamente, por lo que no hay ningún mecanismo para devolver los puntos originales.The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure. Se utiliza una curva spline cardinal porque la curva recorre todos los puntos de la matriz.A cardinal spline curve is used because the curve travels through each of the points in the array.

``````public:
``public void AddCurve (System.Drawing.Point[] points);``
``member this.AddCurve : System.Drawing.Point[] -> unit``
``Public Sub AddCurve (points As Point())``

#### Parámetros

points
Point[]

Matriz de estructuras Point que representa los puntos que definen la curva.An array of Point structures that represents the points that define the curve.

### Ejemplos

Para obtener un ejemplo, vea AddClosedCurve(Point[], Single).For an example, see AddClosedCurve(Point[], Single).

### Comentarios

El usuario debe conservar los puntos originales si es necesario.The user must keep the original points if they are needed. Los puntos originales se convierten en puntos de control Bézier cúbicos internamente, por lo que no hay ningún mecanismo para devolver los puntos originales.The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.

Agrega una curva spline a la figura actual.Adds a spline curve to the current figure.

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

#### Parámetros

points
Point[]

Matriz de estructuras Point que representa los puntos que definen la curva.An array of Point structures that represents the points that define the curve.

tension
Single

Valor que especifica la inclinación de la curva entre puntos de control.A value that specifies the amount that the curve bends between control points. Los valores mayores que 1 producen resultados impredecibles.Values greater than 1 produce unpredictable results.

### Ejemplos

Para obtener un ejemplo, vea AddClosedCurve(Point[], Single).For an example, see AddClosedCurve(Point[], Single).

### Comentarios

El usuario debe conservar los puntos originales si es necesario.The user must keep the original points if they are needed. Los puntos originales se convierten en puntos de control Bézier cúbicos internamente, por lo que no hay ningún mecanismo para devolver los puntos originales.The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.