Graphics.DrawLines メソッド

定義

Point 構造体の配列を接続する一連の線分を描画します。

オーバーロード

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

Point 構造体の配列を接続する一連の線分を描画します。

DrawLines(Pen, PointF[])

PointF 構造体の配列を接続する一連の線分を描画します。

DrawLines(Pen, ReadOnlySpan<Point>)

ソース:
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>)

ソース:
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[])

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 構造体の配列。

例外

pennullです。

または

pointsnullです。

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーの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

注釈

このメソッドは、終了点の配列を接続する一連の線を描画します。 配列内の最初の 2 つのポイントは、最初の行を指定します。 各追加点は、始点が前の線分セグメントの終点である線分セグメントの終点を指定します。

適用対象

DrawLines(Pen, PointF[])

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
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 構造体の配列。

例外

pennullです。

または

pointsnullです。

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーの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

注釈

このメソッドは、終了点の配列を接続する一連の線を描画します。 配列内の最初の 2 つのポイントは、最初の行を指定します。 各追加点は、始点が前の線分セグメントの終点である線分セグメントの終点を指定します。

適用対象