GraphicsPath.AddBezier Método

Definición

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

Sobrecargas

AddBezier(Single, Single, Single, Single, Single, Single, Single, Single)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

AddBezier(Point, Point, Point, Point)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

AddBezier(PointF, PointF, PointF, PointF)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

AddBezier(Single, Single, Single, Single, Single, Single, Single, Single)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

public:
 void AddBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
member this.AddBezier : single * single * single * single * single * single * single * single -> unit
Public Sub AddBezier (x1 As Single, y1 As Single, x2 As Single, y2 As Single, x3 As Single, y3 As Single, x4 As Single, y4 As Single)

Parámetros

x1
Single

Coordenada x del punto inicial de la curva.The x-coordinate of the starting point of the curve.

y1
Single

Coordenada y del punto inicial de la curva.The y-coordinate of the starting point of the curve.

x2
Single

Coordenada x del primer punto de control para la curva.The x-coordinate of the first control point for the curve.

y2
Single

Coordenada y del primer punto de control para la curva.The y-coordinate of the first control point for the curve.

x3
Single

Coordenada x del segundo punto de control para la curva.The x-coordinate of the second control point for the curve.

y3
Single

Coordenada y del segundo punto de control para la curva.The y-coordinate of the second control point for the curve.

x4
Single

Coordenada x del extremo de la curva.The x-coordinate of the endpoint of the curve.

y4
Single

Coordenada y del extremo de la curva.The y-coordinate of the endpoint of the curve.

Ejemplos

Para obtener un ejemplo, vea AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).For an example, see AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).

Comentarios

La curva cúbica se construye desde el primer punto hasta el cuarto punto utilizando el segundo y tercer punto como puntos de control.The cubic curve is constructed from the first point to the fourth point by using the second and third points as control points.

Si hay un segmento de línea o de curva anterior en la ilustración, se agrega una línea para conectar el punto de conexión del segmento anterior al punto inicial de la curva cúbica.If there is a previous line or curve segment in the figure, a line is added to connect the endpoint of the previous segment to the starting point of the cubic curve.

AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

public:
 void AddBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
member this.AddBezier : int * int * int * int * int * int * int * int -> unit
Public Sub AddBezier (x1 As Integer, y1 As Integer, x2 As Integer, y2 As Integer, x3 As Integer, y3 As Integer, x4 As Integer, y4 As Integer)

Parámetros

x1
Int32

Coordenada x del punto inicial de la curva.The x-coordinate of the starting point of the curve.

y1
Int32

Coordenada y del punto inicial de la curva.The y-coordinate of the starting point of the curve.

x2
Int32

Coordenada x del primer punto de control para la curva.The x-coordinate of the first control point for the curve.

y2
Int32

Coordenada y del primer punto de control para la curva.The y-coordinate of the first control point for the curve.

x3
Int32

Coordenada x del segundo punto de control para la curva.The x-coordinate of the second control point for the curve.

y3
Int32

Coordenada y del segundo punto de control para la curva.The y-coordinate of the second control point for the curve.

x4
Int32

Coordenada x del extremo de la curva.The x-coordinate of the endpoint of the curve.

y4
Int32

Coordenada y del extremo de la curva.The y-coordinate of the endpoint of the curve.

Ejemplos

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

  • Crea una ruta de acceso.Creates a path.

  • Agrega una curva Bézier cúbica definida por los puntos (50, 50), (70, 0), (100, 120) y (150, 50) al trazado.Adds a cubic Bézier curve defined by the points (50, 50), (70, 0), (100, 120), and (150, 50) to the path.

  • Cierra la curva.Closes the curve.

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

private:
   void AddBezierExample( PaintEventArgs^ e )
   {
      // Create a new Path.
      GraphicsPath^ myPath = gcnew GraphicsPath;

      // Call AddBezier.
      myPath->StartFigure();
      myPath->AddBezier( 50, 50, 70, 0, 100, 120, 150, 50 );

      // Close the curve.
      myPath->CloseFigure();

      // Draw the path to screen.
      e->Graphics->DrawPath( gcnew Pen( Color::Red,2.0f ), myPath );
   }
private void AddBezierExample(PaintEventArgs e)
{
             
    // Create a new Path.
    GraphicsPath myPath = new GraphicsPath();
             
    // Call AddBezier.
    myPath.StartFigure();
    myPath.AddBezier(50, 50, 70, 0, 100, 120, 150, 50);
             
    // Close the curve.
    myPath.CloseFigure();
             
    // Draw the path to screen.
    e.Graphics.DrawPath(new Pen(Color.Red, 2), myPath);
}
Public Sub AddBezierExample(ByVal e As PaintEventArgs)

    ' Create a new Path.
    Dim myPath As New GraphicsPath

    ' Call AddBezier.
    myPath.StartFigure()
    myPath.AddBezier(50, 50, 70, 0, 100, 120, 150, 50)

    ' Close the curve.
    myPath.CloseFigure()

    ' Draw the path to screen.
    e.Graphics.DrawPath(New Pen(Color.Red, 2), myPath)
End Sub

Comentarios

La curva cúbica se construye desde el primer punto hasta el cuarto punto utilizando el segundo y tercer punto como puntos de control.The cubic curve is constructed from the first point to the fourth point by using the second and third points as control points.

Si hay un segmento de línea o de curva anterior en la ilustración, se agrega una línea para conectar el punto de conexión del segmento anterior al punto inicial de la curva cúbica.If there is a previous line or curve segment in the figure, a line is added to connect the endpoint of the previous segment to the starting point of the cubic curve.

AddBezier(Point, Point, Point, Point)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

public:
 void AddBezier(System::Drawing::Point pt1, System::Drawing::Point pt2, System::Drawing::Point pt3, System::Drawing::Point pt4);
public void AddBezier (System.Drawing.Point pt1, System.Drawing.Point pt2, System.Drawing.Point pt3, System.Drawing.Point pt4);
member this.AddBezier : System.Drawing.Point * System.Drawing.Point * System.Drawing.Point * System.Drawing.Point -> unit
Public Sub AddBezier (pt1 As Point, pt2 As Point, pt3 As Point, pt4 As Point)

Parámetros

pt1
Point

Point que representa el punto inicial de la curva.A Point that represents the starting point of the curve.

pt2
Point

Point que representa el primer punto de control de la curva.A Point that represents the first control point for the curve.

pt3
Point

Point que representa el segundo punto de control de la curva.A Point that represents the second control point for the curve.

pt4
Point

Point que representa el extremo de la curva.A Point that represents the endpoint of the curve.

Ejemplos

Para obtener un ejemplo, vea AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).For an example, see AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).

Comentarios

La curva cúbica se construye desde el primer punto hasta el cuarto punto utilizando el segundo y tercer punto como puntos de control.The cubic curve is constructed from the first point to the fourth point by using the second and third points as control points.

Si hay un segmento de línea o de curva anterior en la ilustración, se agrega una línea para conectar el punto de conexión del segmento anterior al punto inicial de la curva cúbica.If there is a previous line or curve segment in the figure, a line is added to connect the endpoint of the previous segment to the starting point of the cubic curve.

AddBezier(PointF, PointF, PointF, PointF)

Agrega una curva Bézier cúbica a la figura actual.Adds a cubic Bézier curve to the current figure.

public:
 void AddBezier(System::Drawing::PointF pt1, System::Drawing::PointF pt2, System::Drawing::PointF pt3, System::Drawing::PointF pt4);
public void AddBezier (System.Drawing.PointF pt1, System.Drawing.PointF pt2, System.Drawing.PointF pt3, System.Drawing.PointF pt4);
member this.AddBezier : System.Drawing.PointF * System.Drawing.PointF * System.Drawing.PointF * System.Drawing.PointF -> unit
Public Sub AddBezier (pt1 As PointF, pt2 As PointF, pt3 As PointF, pt4 As PointF)

Parámetros

pt1
PointF

PointF que representa el punto inicial de la curva.A PointF that represents the starting point of the curve.

pt2
PointF

PointF que representa el primer punto de control de la curva.A PointF that represents the first control point for the curve.

pt3
PointF

PointF que representa el segundo punto de control de la curva.A PointF that represents the second control point for the curve.

pt4
PointF

PointF que representa el extremo de la curva.A PointF that represents the endpoint of the curve.

Ejemplos

Para obtener un ejemplo, vea AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).For an example, see AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).

Comentarios

La curva cúbica se construye desde el primer punto hasta el cuarto punto utilizando el segundo y tercer punto como puntos de control.The cubic curve is constructed from the first point to the fourth point by using the second and third points as control points.

Si hay un segmento de línea o de curva anterior en la ilustración, se agrega una línea para conectar el punto de conexión del segmento anterior al punto inicial de la curva cúbica.If there is a previous line or curve segment in the figure, a line is added to connect the endpoint of the previous segment to the starting point of the cubic curve.

Se aplica a