Graphics.DrawLines Graphics.DrawLines Graphics.DrawLines Method

정의

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

오버로드

DrawLines(Pen, Point[]) DrawLines(Pen, Point[]) DrawLines(Pen, Point[])

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

DrawLines(Pen, PointF[]) DrawLines(Pen, PointF[]) DrawLines(Pen, PointF[])

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

DrawLines(Pen, Point[]) DrawLines(Pen, Point[]) 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

매개 변수

pen
Pen 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.

예외

pennull입니다.pen is null.

또는-or- pointsnull인 경우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:

  • Black 펜을 만듭니다.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[]) DrawLines(Pen, PointF[]) 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

매개 변수

pen
Pen 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.

예외

pennull입니다.pen is null.

또는-or- pointsnull입니다.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.

적용 대상