GraphicsPath.AddPolygon Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Agrega un polígono a este trazado.
Sobrecargas
AddPolygon(ReadOnlySpan<Point>) | |
AddPolygon(Point[]) |
Agrega un polígono a este trazado. |
AddPolygon(PointF[]) |
Agrega un polígono a este trazado. |
AddPolygon(ReadOnlySpan<PointF>) |
AddPolygon(ReadOnlySpan<Point>)
- Source:
- GraphicsPath.cs
public:
void AddPolygon(ReadOnlySpan<System::Drawing::Point> points);
public void AddPolygon (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>
Se aplica a
AddPolygon(Point[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Agrega un polígono a este trazado.
public:
void AddPolygon(cli::array <System::Drawing::Point> ^ points);
public void AddPolygon (System.Drawing.Point[] points);
member this.AddPolygon : System.Drawing.Point[] -> unit
Public Sub AddPolygon (points As Point())
Parámetros
Ejemplos
El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse
, un OnPaint objeto de evento. El código realiza las siguientes acciones:
Crea una matriz de puntos que define un polígono.
Crea una ruta de acceso y agrega el polígono a la ruta de acceso.
Dibuja la ruta de acceso a la pantalla.
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
Comentarios
Los puntos de la points
matriz especifican los vértices de un polígono. Si el primer punto de la matriz no es el mismo que el último punto, esos dos puntos se conectan para cerrar el polígono.
Se aplica a
AddPolygon(PointF[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Agrega un polígono a este trazado.
public:
void AddPolygon(cli::array <System::Drawing::PointF> ^ points);
public void AddPolygon (System.Drawing.PointF[] points);
member this.AddPolygon : System.Drawing.PointF[] -> unit
Public Sub AddPolygon (points As PointF())
Parámetros
Ejemplos
Para obtener un ejemplo, consulte AddPolygon(Point[]).
Comentarios
Los puntos de la points
matriz especifican los vértices de un polígono. Si el primer punto de la matriz no es el mismo que el último punto, esos dos puntos se conectan para cerrar el polígono.
Se aplica a
AddPolygon(ReadOnlySpan<PointF>)
- Source:
- GraphicsPath.cs
public:
void AddPolygon(ReadOnlySpan<System::Drawing::PointF> points);
public void AddPolygon (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>
Se aplica a
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente las Cuestiones de GitHub como mecanismo de retroalimentación para el contenido y lo sustituiremos por un nuevo sistema de retroalimentación. Para más información, consulta:Enviar y ver comentarios de