Graphics.DrawLines 메서드

정의

Point 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.Draws a series of line segments that connect an array of Point structures.

오버로드

DrawLines(Pen, Point[])

Point 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.Draws a series of line segments that connect an array of Point structures.

DrawLines(Pen, PointF[])

PointF 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.Draws a series of line segments that connect an array of PointF structures.

DrawLines(Pen, Point[])

Point 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.Draws a series of line segments that connect an array of Point structures.

public:
 void DrawLines(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points);
public void DrawLines (System.Drawing.Pen pen, System.Drawing.Point[] points);
member this.DrawLines : System.Drawing.Pen * System.Drawing.Point[] -> unit
Public Sub DrawLines (pen As Pen, points As Point())

매개 변수

pen
Pen

선분의 색, 너비 및 스타일을 결정하는 Pen입니다.Pen that determines the color, width, and style of the line segments.

points
Point[]

연결할 점을 나타내는 Point 구조체의 배열입니다.Array of Point structures that represent the points to connect.

예외

pen이(가) null인 경우pen is null.

또는-or- points이(가) null인 경우points is null.

예제

다음 코드 예제는 Windows Forms와 함께 사용 하도록 설계 되었으며 PaintEventArgs e 이벤트 처리기의 매개 변수인가 필요 합니다 Paint .The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 코드는 다음 작업을 수행합니다.The code performs the following actions:

  • 검정 펜을 만듭니다.Creates a black pen.

  • 선 세그먼트의 점으로 이루어진 배열을 만듭니다.Creates an array of points of segments of the line.

  • 연결 된 선 세그먼트를 화면에 그립니다.Draws the connected line segments to the screen.

public:
   void DrawLinesPoint( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ pen = gcnew Pen( Color::Black,3.0f );

      // Create array of points that define lines to draw.
      array<Point>^ points = {Point(10,10),Point(10,100),Point(200,50),Point(250,300)};

      //Draw lines to screen.
      e->Graphics->DrawLines( pen, points );
   }
public void DrawLinesPoint(PaintEventArgs e)
{
             
    // Create pen.
    Pen pen = new Pen(Color.Black, 3);
             
    // Create array of points that define lines to draw.
    Point[] points =
             {
                 new Point(10,  10),
                 new Point(10, 100),
                 new Point(200,  50),
                 new Point(250, 300)
             };
             
    //Draw lines to screen.
    e.Graphics.DrawLines(pen, points);
}
Public Sub DrawLinesPoint(ByVal e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New Pen(Color.Black, 3)

    ' Create array of points that define lines to draw.
    Dim points As Point() = {New Point(10, 10), New Point(10, 100), _
    New Point(200, 50), New Point(250, 300)}

    'Draw lines to screen.
    e.Graphics.DrawLines(blackPen, points)
End Sub

설명

이 메서드는 끝점의 배열을 연결 하는 일련의 선을 그립니다.This method draws a series of lines connecting an array of ending points. 배열의 처음 두 점은 첫 번째 줄을 지정 합니다.The first two points in the array specify the first line. 각 추가 점은 시작점이 이전 줄 세그먼트의 끝 지점인 선 세그먼트의 끝을 지정 합니다.Each additional point specifies the end of a line segment whose starting point is the ending point of the previous line segment.

적용 대상

DrawLines(Pen, PointF[])

PointF 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.Draws a series of line segments that connect an array of PointF structures.

public:
 void DrawLines(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points);
public void DrawLines (System.Drawing.Pen pen, System.Drawing.PointF[] points);
member this.DrawLines : System.Drawing.Pen * System.Drawing.PointF[] -> unit
Public Sub DrawLines (pen As Pen, points As PointF())

매개 변수

pen
Pen

선분의 색, 너비 및 스타일을 결정하는 Pen입니다.Pen that determines the color, width, and style of the line segments.

points
PointF[]

연결할 점을 나타내는 PointF 구조체의 배열입니다.Array of PointF structures that represent the points to connect.

예외

pen이(가) null인 경우pen is null.

또는-or- points이(가) null인 경우points is null.

예제

다음 코드 예제는 Windows Forms와 함께 사용 하도록 설계 되었으며 PaintEventArgs e 이벤트 처리기의 매개 변수인가 필요 합니다 Paint .The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 코드는 다음 작업을 수행합니다.The code performs the following actions:

  • 코드는 검은색 펜을 만듭니다.Code creates a black pen.

  • 선 세그먼트의 점으로 이루어진 배열을 만듭니다.Creates an array of points of segments of the line.

  • 연결 된 선 세그먼트를 화면에 그립니다.Draws the connected line segments to the screen.

public:
   void DrawLinesPointF( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ pen = gcnew Pen( Color::Black,3.0f );

      // Create array of points that define lines to draw.
      array<PointF>^ points = {PointF(10.0F,10.0F),PointF(10.0F,100.0F),PointF(200.0F,50.0F),PointF(250.0F,300.0F)};

      //Draw lines to screen.
      e->Graphics->DrawLines( pen, points );
   }
public void DrawLinesPointF(PaintEventArgs e)
{
             
    // Create pen.
    Pen pen = new Pen(Color.Black, 3);
             
    // Create array of points that define lines to draw.
    PointF[] points =
             {
                 new PointF(10.0F,  10.0F),
                 new PointF(10.0F, 100.0F),
                 new PointF(200.0F,  50.0F),
                 new PointF(250.0F, 300.0F)
             };
             
    //Draw lines to screen.
    e.Graphics.DrawLines(pen, points);
}
Public Sub DrawLinesPointF(ByVal e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New Pen(Color.Black, 3)

    ' Create array of points that define lines to draw.
    Dim points As PointF() = {New PointF(10.0F, 10.0F), _
    New PointF(10.0F, 100.0F), New PointF(200.0F, 50.0F), _
    New PointF(250.0F, 300.0F)}

    'Draw lines to screen.
    e.Graphics.DrawLines(blackPen, points)
End Sub

설명

이 메서드는 끝점의 배열을 연결 하는 일련의 선을 그립니다.This method draws a series of lines connecting an array of ending points. 배열의 처음 두 점은 첫 번째 줄을 지정 합니다.The first two points in the array specify the first line. 각 추가 점은 시작점이 이전 줄 세그먼트의 끝 지점인 선 세그먼트의 끝을 지정 합니다.Each additional point specifies the end of a line segment whose starting point is the ending point of the previous line segment.

적용 대상