GraphicsPath.AddLines Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Acrescenta uma série de segmentos de linha ligados ao final deste GraphicsPath.
Sobrecargas
| Name | Description |
|---|---|
| AddLines(Point[]) |
Acrescenta uma série de segmentos de linha ligados ao final deste GraphicsPath. |
| AddLines(PointF[]) |
Acrescenta uma série de segmentos de linha ligados ao final deste GraphicsPath. |
| AddLines(ReadOnlySpan<Point>) |
Acrescenta uma série de segmentos de linha ligados ao final deste GraphicsPath. |
| AddLines(ReadOnlySpan<PointF>) |
Acrescenta uma série de segmentos de linha ligados ao final deste GraphicsPath. |
AddLines(Point[])
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Acrescenta uma série de segmentos de linha ligados ao final deste 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())
Parâmetros
- points
- Point[]
Um array de Point estruturas que representa os pontos que definem os segmentos de linha a adicionar.
Exemplos
O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, um objeto de evento OnPaint. O código executa as seguintes ações:
Cria um array de quatro pontos que descrevem um triângulo.
Cria um caminho e adiciona o conjunto de linhas.
Desenha o caminho para o ecrã.
Note que cada linha após o primeiro ponto usa o ponto anterior como ponto de partida e o novo ponto como ponto final.
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
Observações
Se existirem linhas ou curvas anteriores na figura, uma linha é adicionada para ligar o ponto final do segmento anterior ao ponto de partida da linha. O points parâmetro especifica um array de endpoints. As duas primeiras especificam a primeira linha. Cada ponto adicional especifica o ponto final de um segmento de linha cujo ponto de partida é o ponto final da linha anterior.
Aplica-se a
AddLines(PointF[])
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Acrescenta uma série de segmentos de linha ligados ao final deste 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())
Parâmetros
- points
- PointF[]
Um array de PointF estruturas que representa os pontos que definem os segmentos de linha a adicionar.
Exceções
Exemplos
Para obter um exemplo, consulte AddLines(Point[]).
Observações
Se existirem linhas ou curvas anteriores na figura, uma linha é adicionada para ligar o ponto final do segmento anterior ao ponto de partida da linha. O points parâmetro especifica um array de endpoints. As duas primeiras especificam a primeira linha. Cada ponto adicional especifica o ponto final de um segmento de linha cujo ponto de partida é o ponto final da linha anterior.
Aplica-se a
AddLines(ReadOnlySpan<Point>)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Acrescenta uma série de segmentos de linha ligados ao final deste 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))
Parâmetros
- points
- ReadOnlySpan<Point>
Um array de PointF estruturas que representa os pontos que definem os segmentos de linha a adicionar.
Aplica-se a
AddLines(ReadOnlySpan<PointF>)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Acrescenta uma série de segmentos de linha ligados ao final deste 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))
Parâmetros
- points
- ReadOnlySpan<PointF>
Um array de PointF estruturas que representa os pontos que definem os segmentos de linha a adicionar.