GraphicsPath.AddLines Método

Definición

Anexa una serie de segmentos de línea conectados al final de este trazado GraphicsPath.

Sobrecargas

AddLines(Point[])

Anexa una serie de segmentos de línea conectados al final de este trazado GraphicsPath.

AddLines(PointF[])

Anexa una serie de segmentos de línea conectados al final de este trazado GraphicsPath.

AddLines(ReadOnlySpan<Point>)
AddLines(ReadOnlySpan<PointF>)

AddLines(Point[])

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Anexa una serie de segmentos de línea conectados al final de este trazado GraphicsPath.

public:
 void AddLines(cli::array <System::Drawing::Point> ^ points);
public:
 void AddLines(... cli::array <System::Drawing::Point> ^ points);
public void AddLines (System.Drawing.Point[] points);
public void AddLines (params System.Drawing.Point[] points);
member this.AddLines : System.Drawing.Point[] -> unit
Public Sub AddLines (points As Point())
Public Sub AddLines (ParamArray points As Point())

Parámetros

points
Point[]

Matriz de estructuras Point que representa los puntos que definen los segmentos de línea que se van a agregar.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, un OnPaint objeto de evento. El código realiza las siguientes acciones:

  • Crea una matriz de cuatro puntos que describen un triángulo.

  • Crea una ruta de acceso y agrega la matriz de líneas.

  • Dibuja la ruta de acceso a la pantalla.

Observe que cada línea después del primer punto usa el punto anterior como punto inicial y el nuevo punto como punto de conexión.

private:
   void AddLinesExample( PaintEventArgs^ e )
   {
      // Create a symetrical triangle using an array of points.
      array<Point>^ myArray = {Point(30,30),Point(60,60),Point(0,60),Point(30,30)};

      //Create a path and add lines.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddLines( myArray );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddLinesExample(PaintEventArgs e)
{
             
    // Create a symmetrical triangle using an array of points.
    Point[] myArray =
             {
                 new Point(30,30),
                 new Point(60,60),
                 new Point(0,60),
                 new Point(30,30)
             };
             
    //Create a path and add lines.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddLines(myArray);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddLinesExample(ByVal e As PaintEventArgs)

    'Create a symmetrical triangle using an array of points.
    Dim myArray As Point() = {New Point(30, 30), New Point(60, 60), _
    New Point(0, 60), New Point(30, 30)}
    Dim myPath As New GraphicsPath
    myPath.AddLines(myArray)

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

Comentarios

Si hay líneas o curvas anteriores en la ilustración, se agrega una línea para conectar el punto de conexión del segmento anterior el punto inicial de la línea. El points parámetro especifica una matriz de puntos de conexión. Las dos primeras especifican la primera línea. Cada punto adicional especifica el extremo de un segmento de línea cuyo punto inicial es el punto de conexión de la línea anterior.

Se aplica a

AddLines(PointF[])

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Anexa una serie de segmentos de línea conectados al final de este trazado GraphicsPath.

public:
 void AddLines(cli::array <System::Drawing::PointF> ^ points);
public:
 void AddLines(... cli::array <System::Drawing::PointF> ^ points);
public void AddLines (System.Drawing.PointF[] points);
public void AddLines (params System.Drawing.PointF[] points);
member this.AddLines : System.Drawing.PointF[] -> unit
Public Sub AddLines (points As PointF())
Public Sub AddLines (ParamArray points As PointF())

Parámetros

points
PointF[]

Matriz de estructuras PointF que representa los puntos que definen los segmentos de línea que se van a agregar.

Ejemplos

Para obtener un ejemplo, consulte AddLines(Point[]).

Comentarios

Si hay líneas o curvas anteriores en la ilustración, se agrega una línea para conectar el punto de conexión del segmento anterior el punto inicial de la línea. El points parámetro especifica una matriz de puntos de conexión. Las dos primeras especifican la primera línea. Cada punto adicional especifica el extremo de un segmento de línea cuyo punto inicial es el punto de conexión de la línea anterior.

Se aplica a

AddLines(ReadOnlySpan<Point>)

Source:
GraphicsPath.cs
public:
 void AddLines(ReadOnlySpan<System::Drawing::Point> points);
public void AddLines (ReadOnlySpan<System.Drawing.Point> points);
member this.AddLines : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub AddLines (points As ReadOnlySpan(Of Point))

Parámetros

Se aplica a

AddLines(ReadOnlySpan<PointF>)

Source:
GraphicsPath.cs
public:
 void AddLines(ReadOnlySpan<System::Drawing::PointF> points);
public void AddLines (ReadOnlySpan<System.Drawing.PointF> points);
member this.AddLines : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub AddLines (points As ReadOnlySpan(Of PointF))

Parámetros

Se aplica a