GraphicsPath.AddLines Yöntem

Tanım

Bu GraphicsPathöğesinin sonuna bir dizi bağlı çizgi kesimi ekler.

Aşırı Yüklemeler

AddLines(Point[])

Bu GraphicsPathöğesinin sonuna bir dizi bağlı çizgi kesimi ekler.

AddLines(PointF[])

Bu GraphicsPathöğesinin sonuna bir dizi bağlı çizgi kesimi ekler.

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

AddLines(Point[])

Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs

Bu GraphicsPathöğesinin sonuna bir dizi bağlı çizgi kesimi ekler.

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())

Parametreler

points
Point[]

Eklenecek çizgi kesimlerini tanımlayan noktaları temsil eden yapı dizisi Point .

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve bir OnPaint olay nesnesi gerektirir.PaintEventArgse Kod aşağıdaki eylemleri gerçekleştirir:

  • Bir üçgeni tanımlayan dört noktadan oluşan bir dizi oluşturur.

  • Bir yol oluşturur ve satır dizisini ekler.

  • Ekranın yolunu çizer.

İlk noktadan sonraki her satırın başlangıç noktası olarak önceki noktayı, uç nokta olarak da yeni noktayı kullandığına dikkat edin.

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

Açıklamalar

Şekilde önceki çizgiler veya eğriler varsa, önceki segmentin bitiş noktasını çizginin başlangıç noktasına bağlamak için bir çizgi eklenir. points parametresi bir uç nokta dizisi belirtir. İlk ikisi ilk satırı belirtir. Her ek nokta, başlangıç noktası önceki satırın uç noktası olan bir çizgi kesiminin uç noktasını belirtir.

Şunlara uygulanır

AddLines(PointF[])

Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs

Bu GraphicsPathöğesinin sonuna bir dizi bağlı çizgi kesimi ekler.

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())

Parametreler

points
PointF[]

Eklenecek çizgi kesimlerini tanımlayan noktaları temsil eden yapı dizisi PointF .

Örnekler

Örnek için bkz. AddLines(Point[])

Açıklamalar

Şekilde önceki çizgiler veya eğriler varsa, önceki segmentin bitiş noktasını çizginin başlangıç noktasına bağlamak için bir çizgi eklenir. points parametresi bir uç nokta dizisi belirtir. İlk ikisi ilk satırı belirtir. Her ek nokta, başlangıç noktası önceki satırın uç noktası olan bir çizgi kesiminin uç noktasını belirtir.

Şunlara uygulanır

AddLines(ReadOnlySpan<Point>)

Kaynak:
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))

Parametreler

Şunlara uygulanır

AddLines(ReadOnlySpan<PointF>)

Kaynak:
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))

Parametreler

Şunlara uygulanır