GraphicsPath.AddPolygon 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.
Adiciona um polígono a este caminho.
Sobrecargas
| Name | Description |
|---|---|
| AddPolygon(ReadOnlySpan<Point>) |
Adiciona um polígono a este caminho. |
| AddPolygon(Point[]) |
Adiciona um polígono a este caminho. |
| AddPolygon(PointF[]) |
Adiciona um polígono a este caminho. |
| AddPolygon(ReadOnlySpan<PointF>) |
Adiciona um polígono a este caminho. |
AddPolygon(ReadOnlySpan<Point>)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Adiciona um polígono a este caminho.
public:
void AddPolygon(ReadOnlySpan<System::Drawing::Point> points);
public void AddPolygon(scoped ReadOnlySpan<System.Drawing.Point> points);
member this.AddPolygon : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub AddPolygon (points As ReadOnlySpan(Of Point))
Parâmetros
- points
- ReadOnlySpan<Point>
Um array de Point estruturas que define o polígono a somar.
Aplica-se a
AddPolygon(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
Adiciona um polígono a este caminho.
public:
void AddPolygon(... cli::array <System::Drawing::Point> ^ points);
public:
void AddPolygon(cli::array <System::Drawing::Point> ^ points);
public void AddPolygon(params System.Drawing.Point[] points);
public void AddPolygon(System.Drawing.Point[] points);
member this.AddPolygon : System.Drawing.Point[] -> unit
Public Sub AddPolygon (ParamArray points As Point())
Public Sub AddPolygon (points As Point())
Parâmetros
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 pontos que define um polígono.
Cria um caminho e adiciona o polígono ao caminho.
Desenha o caminho até ao ecrã.
private:
void AddPolygonExample( PaintEventArgs^ e )
{
// Create an array of points.
array<Point>^ myArray = {Point(23,20),Point(40,10),Point(57,20),Point(50,40),Point(30,40)};
// Create a GraphicsPath object and add a polygon.
GraphicsPath^ myPath = gcnew GraphicsPath;
myPath->AddPolygon( myArray );
// Draw the path to the screen.
Pen^ myPen = gcnew Pen( Color::Black,2.0f );
e->Graphics->DrawPath( myPen, myPath );
}
private void AddPolygonExample(PaintEventArgs e)
{
// Create an array of points.
Point[] myArray =
{
new Point(23, 20),
new Point(40, 10),
new Point(57, 20),
new Point(50, 40),
new Point(30, 40)
};
// Create a GraphicsPath object and add a polygon.
GraphicsPath myPath = new GraphicsPath();
myPath.AddPolygon(myArray);
// Draw the path to the screen.
Pen myPen = new Pen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddPolygonExample(ByVal e As PaintEventArgs)
' Create an array of points.
Dim myArray As Point() = {New Point(23, 20), New Point(40, 10), _
New Point(57, 20), New Point(50, 40), New Point(30, 40)}
' Create a GraphicsPath object and add a polygon.
Dim myPath As New GraphicsPath
myPath.AddPolygon(myArray)
' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub
Observações
Os pontos no points array especificam os vértices de um polígono. Se o primeiro ponto do array não for o mesmo que o último, esses dois pontos são ligados para fechar o polígono.
Aplica-se a
AddPolygon(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
Adiciona um polígono a este caminho.
public:
void AddPolygon(... cli::array <System::Drawing::PointF> ^ points);
public:
void AddPolygon(cli::array <System::Drawing::PointF> ^ points);
public void AddPolygon(params System.Drawing.PointF[] points);
public void AddPolygon(System.Drawing.PointF[] points);
member this.AddPolygon : System.Drawing.PointF[] -> unit
Public Sub AddPolygon (ParamArray points As PointF())
Public Sub AddPolygon (points As PointF())
Parâmetros
Exemplos
Para obter um exemplo, consulte AddPolygon(Point[]).
Observações
Os pontos no points array especificam os vértices de um polígono. Se o primeiro ponto do array não for o mesmo que o último, esses dois pontos são ligados para fechar o polígono.
Aplica-se a
AddPolygon(ReadOnlySpan<PointF>)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Adiciona um polígono a este caminho.
public:
void AddPolygon(ReadOnlySpan<System::Drawing::PointF> points);
public void AddPolygon(scoped ReadOnlySpan<System.Drawing.PointF> points);
member this.AddPolygon : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub AddPolygon (points As ReadOnlySpan(Of PointF))
Parâmetros
- points
- ReadOnlySpan<PointF>
Um array de Point estruturas que define o polígono a somar.