GraphicsPath.AddLines 메서드

정의

연결된 일련의 선 세그먼트를 이 GraphicsPath의 끝에 추가합니다.

오버로드

AddLines(Point[])

연결된 일련의 선 세그먼트를 이 GraphicsPath의 끝에 추가합니다.

AddLines(PointF[])

연결된 일련의 선 세그먼트를 이 GraphicsPath의 끝에 추가합니다.

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

AddLines(Point[])

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

연결된 일련의 선 세그먼트를 이 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())

매개 변수

points
Point[]

추가할 선 세그먼트를 정의하는 지점을 나타내는 Point 구조체의 배열입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 개체인 이 OnPaint 필요합니다PaintEventArgse. 코드는 다음 작업을 수행합니다.

  • 삼각형을 설명하는 4개의 점 배열을 만듭니다.

  • 경로를 만들고 선 배열을 추가합니다.

  • 화면의 경로를 그립니다.

첫 번째 점 뒤의 각 줄은 이전 지점을 시작점으로 사용하고 새 점을 엔드포인트로 사용합니다.

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[])

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

연결된 일련의 선 세그먼트를 이 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())

매개 변수

points
PointF[]

추가할 선 세그먼트를 정의하는 지점을 나타내는 PointF 구조체의 배열입니다.

예제

예제를 보려면 AddLines(Point[])를 참조하세요.

설명

그림에 이전 선 또는 곡선이 있는 경우 선이 추가되어 이전 세그먼트의 엔드포인트를 선의 시작점에 연결합니다. 매개 변수는 points 엔드포인트의 배열을 지정합니다. 처음 두 줄은 첫 번째 줄을 지정합니다. 각 추가 지점은 시작점이 이전 줄의 엔드포인트인 선 세그먼트의 엔드포인트를 지정합니다.

적용 대상

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

매개 변수

적용 대상

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

매개 변수

적용 대상