GraphicsPath.AddLines Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Appends a series of connected line segments to the end of this GraphicsPath.
Overloads
AddLines(Point[]) |
Appends a series of connected line segments to the end of this GraphicsPath. |
AddLines(PointF[]) |
Appends a series of connected line segments to the end of this GraphicsPath. |
AddLines(ReadOnlySpan<Point>) |
Appends a series of connected line segments to the end of this GraphicsPath. |
AddLines(ReadOnlySpan<PointF>) |
Appends a series of connected line segments to the end of this GraphicsPath. |
AddLines(Point[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Appends a series of connected line segments to the end of this GraphicsPath.
public:
void AddLines(... cli::array <System::Drawing::Point> ^ points);
public:
void AddLines(cli::array <System::Drawing::Point> ^ points);
public void AddLines (params System.Drawing.Point[] points);
public void AddLines (System.Drawing.Point[] points);
member this.AddLines : System.Drawing.Point[] -> unit
Public Sub AddLines (ParamArray points As Point())
Public Sub AddLines (points As Point())
Parameters
- points
- Point[]
An array of Point structures that represents the points that define the line segments to add.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e
, an OnPaint event object. The code performs the following actions:
Creates an array of four points that describe a triangle.
Creates a path and adds the array of lines.
Draws the path to screen.
Notice that each line after the first point uses the previous point as the starting point and the new point as the endpoint.
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
Remarks
If there are previous lines or curves in the figure, a line is added to connect the endpoint of the previous segment the starting point of the line. The points
parameter specifies an array of endpoints. The first two specify the first line. Each additional point specifies the endpoint of a line segment whose starting point is the endpoint of the previous line.
Applies to
AddLines(PointF[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Appends a series of connected line segments to the end of this GraphicsPath.
public:
void AddLines(... cli::array <System::Drawing::PointF> ^ points);
public:
void AddLines(cli::array <System::Drawing::PointF> ^ points);
public void AddLines (params System.Drawing.PointF[] points);
public void AddLines (System.Drawing.PointF[] points);
member this.AddLines : System.Drawing.PointF[] -> unit
Public Sub AddLines (ParamArray points As PointF())
Public Sub AddLines (points As PointF())
Parameters
- points
- PointF[]
An array of PointF structures that represents the points that define the line segments to add.
Exceptions
Examples
For an example, see AddLines(Point[]).
Remarks
If there are previous lines or curves in the figure, a line is added to connect the endpoint of the previous segment the starting point of the line. The points
parameter specifies an array of endpoints. The first two specify the first line. Each additional point specifies the endpoint of a line segment whose starting point is the endpoint of the previous line.
Applies to
AddLines(ReadOnlySpan<Point>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Appends a series of connected line segments to the end of this GraphicsPath.
public:
void AddLines(ReadOnlySpan<System::Drawing::Point> points);
public void AddLines (scoped ReadOnlySpan<System.Drawing.Point> points);
member this.AddLines : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub AddLines (points As ReadOnlySpan(Of Point))
Parameters
- points
- ReadOnlySpan<Point>
An array of PointF structures that represents the points that define the line segments to add.
Applies to
AddLines(ReadOnlySpan<PointF>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Appends a series of connected line segments to the end of this GraphicsPath.
public:
void AddLines(ReadOnlySpan<System::Drawing::PointF> points);
public void AddLines (scoped ReadOnlySpan<System.Drawing.PointF> points);
member this.AddLines : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub AddLines (points As ReadOnlySpan(Of PointF))
Parameters
- points
- ReadOnlySpan<PointF>
An array of PointF structures that represents the points that define the line segments to add.