Graphics.DrawLines 메서드

정의

Point 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.

오버로드

DrawLines(Pen, ReadOnlySpan<Point>)
DrawLines(Pen, ReadOnlySpan<PointF>)
DrawLines(Pen, Point[])

Point 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.

DrawLines(Pen, PointF[])

PointF 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.

DrawLines(Pen, ReadOnlySpan<Point>)

Source:
Graphics.cs
public:
 void DrawLines(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points);
public void DrawLines (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.Point> points);
member this.DrawLines : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub DrawLines (pen As Pen, points As ReadOnlySpan(Of Point))

매개 변수

pen
Pen

적용 대상

DrawLines(Pen, ReadOnlySpan<PointF>)

Source:
Graphics.cs
public:
 void DrawLines(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points);
public void DrawLines (System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points);
member this.DrawLines : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub DrawLines (pen As Pen, points As ReadOnlySpan(Of PointF))

매개 변수

pen
Pen

적용 대상

DrawLines(Pen, Point[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Point 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.

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

매개 변수

pen
Pen

선분의 색, 너비 및 스타일을 결정하는 Pen입니다.

points
Point[]

연결할 점을 나타내는 Point 구조체의 배열입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 검은색 펜을 만듭니다.

  • 선의 세그먼트 요소 배열을 만듭니다.

  • 연결된 선 세그먼트를 화면에 그립니다.

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

설명

이 메서드는 끝점 배열을 연결하는 일련의 선을 그립니다. 배열의 처음 두 점은 첫 번째 줄을 지정합니다. 각 추가 지점은 시작점이 이전 선 세그먼트의 끝점인 선 세그먼트의 끝을 지정합니다.

적용 대상

DrawLines(Pen, PointF[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

PointF 구조체의 배열을 연결하는 일련의 선 세그먼트를 그립니다.

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입니다.

points
PointF[]

연결할 점을 나타내는 PointF 구조체의 배열입니다.

예외

pen이(가) null인 경우

또는

points이(가) null인 경우

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 코드는 검은색 펜을 만듭니다.

  • 선의 세그먼트 요소 배열을 만듭니다.

  • 연결된 선 세그먼트를 화면에 그립니다.

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

설명

이 메서드는 끝점 배열을 연결하는 일련의 선을 그립니다. 배열의 처음 두 점은 첫 번째 줄을 지정합니다. 각 추가 지점은 시작점이 이전 선 세그먼트의 끝점인 선 세그먼트의 끝을 지정합니다.

적용 대상