Share via


GraphicsPath.AddLines Metodo

Definizione

Accoda una serie di segmenti di linea collegati alla fine di questa classe GraphicsPath.

Overload

AddLines(Point[])

Accoda una serie di segmenti di linea collegati alla fine di questa classe GraphicsPath.

AddLines(PointF[])

Accoda una serie di segmenti di linea collegati alla fine di questa classe GraphicsPath.

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

AddLines(Point[])

Origine:
GraphicsPath.cs
Origine:
GraphicsPath.cs
Origine:
GraphicsPath.cs

Accoda una serie di segmenti di linea collegati alla fine di questa classe 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())

Parametri

points
Point[]

Matrice di strutture Point che rappresenta i punti che definiscono i segmenti di linea da aggiungere.

Esempio

L'esempio di codice seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse, un OnPaint oggetto evento. Il codice esegue le azioni seguenti:

  • Crea una matrice di quattro punti che descrivono un triangolo.

  • Crea un percorso e aggiunge la matrice di righe.

  • Disegna il percorso dello schermo.

Si noti che ogni riga dopo il primo punto usa il punto precedente come punto iniziale e il nuovo punto come endpoint.

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

Commenti

Se nella figura sono presenti linee o curve precedenti, viene aggiunta una linea per connettere l'endpoint del segmento precedente il punto iniziale della linea. Il points parametro specifica una matrice di endpoint. Le prime due specificano la prima riga. Ogni punto aggiuntivo specifica l'endpoint di un segmento di linea il cui punto iniziale è l'endpoint della riga precedente.

Si applica a

AddLines(PointF[])

Origine:
GraphicsPath.cs
Origine:
GraphicsPath.cs
Origine:
GraphicsPath.cs

Accoda una serie di segmenti di linea collegati alla fine di questa classe 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())

Parametri

points
PointF[]

Matrice di strutture PointF che rappresenta i punti che definiscono i segmenti di linea da aggiungere.

Esempio

Per un esempio, vedere AddLines(Point[]).

Commenti

Se nella figura sono presenti linee o curve precedenti, viene aggiunta una linea per connettere l'endpoint del segmento precedente il punto iniziale della linea. Il points parametro specifica una matrice di endpoint. Le prime due specificano la prima riga. Ogni punto aggiuntivo specifica l'endpoint di un segmento di linea il cui punto iniziale è l'endpoint della riga precedente.

Si applica a

AddLines(ReadOnlySpan<Point>)

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

Parametri

Si applica a

AddLines(ReadOnlySpan<PointF>)

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

Parametri

Si applica a