語言

GraphicsPath.AddLines 方法

定義

在此末尾 GraphicsPath附加一系列連通線段。

多載

名稱 Description
AddLines(Point[])

在此末尾 GraphicsPath附加一系列連通線段。

AddLines(PointF[])

在此末尾 GraphicsPath附加一系列連通線段。

AddLines(ReadOnlySpan<Point>)

在此末尾 GraphicsPath附加一系列連通線段。

AddLines(ReadOnlySpan<PointF>)

在此末尾 GraphicsPath附加一系列連通線段。

AddLines(Point[])

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

在此末尾 GraphicsPath附加一系列連通線段。

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

參數

points
Point[]

一個結構陣列 Point ,代表定義要加的線段點。

範例

以下程式碼範例是為 Windows Forms 設計,並需要 PaintEventArgse,一個 OnPaint 事件物件。 此程式碼會執行下列動作:

  • 建立一個由四個點組成的陣列,描述一個三角形。

  • 建立一條路徑並加入線條陣列。

  • 畫出通往螢幕的路徑。

注意,第一點之後的每條線都以前一個點為起點,以新點為終點。

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

備註

若圖中有先前的線條或曲線,則會加入一條線,將前一段線段的端點與該線的起點連接起來。 參數 points 指定一個端點陣列。 前兩句指定第一行。 每增加一個點,就指定了一條線段的端點,而該線段的起點是前一條線的端點。

適用於

AddLines(PointF[])

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

在此末尾 GraphicsPath附加一系列連通線段。

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

參數

points
PointF[]

一個結構陣列 PointF ,代表定義要加的線段點。

例外狀況

範例

如需範例,請參閱 AddLines(Point[])。

備註

若圖中有先前的線條或曲線,則會加入一條線,將前一段線段的端點與該線的起點連接起來。 參數 points 指定一個端點陣列。 前兩句指定第一行。 每增加一個點,就指定了一條線段的端點,而該線段的起點是前一條線的端點。

適用於

AddLines(ReadOnlySpan<Point>)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

在此末尾 GraphicsPath附加一系列連通線段。

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

參數

points
ReadOnlySpan<Point>

一個結構陣列 PointF ,代表定義要加的線段點。

適用於

AddLines(ReadOnlySpan<PointF>)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

在此末尾 GraphicsPath附加一系列連通線段。

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

參數

points
ReadOnlySpan<PointF>

一個結構陣列 PointF ,代表定義要加的線段點。

適用於