# Graphics.DrawLinesGraphics.DrawLinesGraphics.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

points
Point[]

#### 例外

`pen``null`です。`pen` is `null`.

- または --or- `points``null`です。`points` is `null`.

### 例

• 黒のペンを作成します。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. 配列内の最初の 2 つの点では、最初の行を指定します。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

points
PointF[]

#### 例外

`pen``null`です。`pen` is `null`.

- または --or- `points``null`です。`points` is `null`.

### 例

• コードでは、黒のペンを作成します。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. 配列内の最初の 2 つの点では、最初の行を指定します。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.