GraphicsPath.AddLines メソッド

定義

GraphicsPath の末尾に、結ばれた一連の線分を追加します。

オーバーロード

AddLines(Point[])

GraphicsPath の末尾に、結ばれた一連の線分を追加します。

AddLines(PointF[])

GraphicsPath の末尾に、結ばれた一連の線分を追加します。

AddLines(ReadOnlySpan<Point>)
AddLines(ReadOnlySpan<PointF>)

AddLines(Point[])

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

GraphicsPath の末尾に、結ばれた一連の線分を追加します。

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

パラメーター

points
Point[]

追加する線分を定義する複数の点を表す Point 構造体の配列。

次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがOnPaint必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • 三角形を表す 4 つのポイントの配列を作成します。

  • パスを作成し、行の配列を追加します。

  • 画面へのパスを描画します。

最初のポイントの後の各行は、開始点として前のポイントを使用し、新しいポイントをエンドポイントとして使用することに注意してください。

private:
   void AddLinesExample( PaintEventArgs^ e )
   {
      // Create a symetrical triangle using an array of points.
      array<Point>^ myArray = {Point(30,30),Point(60,60),Point(0,60),Point(30,30)};

      //Create a path and add lines.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddLines( myArray );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddLinesExample(PaintEventArgs e)
{
             
    // Create a symmetrical triangle using an array of points.
    Point[] myArray =
             {
                 new Point(30,30),
                 new Point(60,60),
                 new Point(0,60),
                 new Point(30,30)
             };
             
    //Create a path and add lines.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddLines(myArray);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddLinesExample(ByVal e As PaintEventArgs)

    'Create a symmetrical triangle using an array of points.
    Dim myArray As Point() = {New Point(30, 30), New Point(60, 60), _
    New Point(0, 60), New Point(30, 30)}
    Dim myPath As New GraphicsPath
    myPath.AddLines(myArray)

    ' Draw the path to the screen.
    Dim myPen As New Pen(Color.Black, 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub

注釈

図に前の線または曲線がある場合は、線の始点である前のセグメントの終点を接続する線が追加されます。 パラメーターは points 、エンドポイントの配列を指定します。 最初の 2 行は、最初の行を指定します。 追加の各点は、始点が前の線分の終点である線分セグメントの終点を指定します。

適用対象

AddLines(PointF[])

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

GraphicsPath の末尾に、結ばれた一連の線分を追加します。

public:
 void AddLines(cli::array <System::Drawing::PointF> ^ points);
public:
 void AddLines(... cli::array <System::Drawing::PointF> ^ points);
public void AddLines (System.Drawing.PointF[] points);
public void AddLines (params System.Drawing.PointF[] points);
member this.AddLines : System.Drawing.PointF[] -> unit
Public Sub AddLines (points As PointF())
Public Sub AddLines (ParamArray points As PointF())

パラメーター

points
PointF[]

追加する線分を定義する複数の点を表す PointF 構造体の配列。

例については、「AddLines(Point[])」を参照してください。

注釈

図に前の線または曲線がある場合は、線の始点である前のセグメントの終点を接続する線が追加されます。 パラメーターは points 、エンドポイントの配列を指定します。 最初の 2 行は、最初の行を指定します。 追加の各点は、始点が前の線分の終点である線分セグメントの終点を指定します。

適用対象

AddLines(ReadOnlySpan<Point>)

ソース:
GraphicsPath.cs
public:
 void AddLines(ReadOnlySpan<System::Drawing::Point> points);
public void AddLines (ReadOnlySpan<System.Drawing.Point> points);
member this.AddLines : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub AddLines (points As ReadOnlySpan(Of Point))

パラメーター

適用対象

AddLines(ReadOnlySpan<PointF>)

ソース:
GraphicsPath.cs
public:
 void AddLines(ReadOnlySpan<System::Drawing::PointF> points);
public void AddLines (ReadOnlySpan<System.Drawing.PointF> points);
member this.AddLines : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub AddLines (points As ReadOnlySpan(Of PointF))

パラメーター

適用対象