GraphicsPath.AddPolygon Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Ajoute un polygone à ce chemin d’accès.
Surcharges
AddPolygon(ReadOnlySpan<Point>) | |
AddPolygon(Point[]) |
Ajoute un polygone à ce chemin d’accès. |
AddPolygon(PointF[]) |
Ajoute un polygone à ce chemin d’accès. |
AddPolygon(ReadOnlySpan<PointF>) |
AddPolygon(ReadOnlySpan<Point>)
- Source:
- GraphicsPath.cs
- 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))
Paramètres
- points
- ReadOnlySpan<Point>
S’applique à
AddPolygon(Point[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Ajoute un polygone à ce chemin d’accès.
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())
Paramètres
Exemples
L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse
, un objet d’événement OnPaint. Le code effectue les actions suivantes :
Crée un tableau de points qui définit un polygone.
Crée un chemin et ajoute le polygone au chemin d’accès.
Dessine le chemin d’accès à l’écran.
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
Remarques
Les points du tableau points
spécifient les sommets d’un polygone. Si le premier point du tableau n’est pas le même que le dernier point, ces deux points sont connectés pour fermer le polygone.
S’applique à
AddPolygon(PointF[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Ajoute un polygone à ce chemin d’accès.
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())
Paramètres
Exemples
Pour obtenir un exemple, consultez AddPolygon(Point[]).
Remarques
Les points du tableau points
spécifient les sommets d’un polygone. Si le premier point du tableau n’est pas le même que le dernier point, ces deux points sont connectés pour fermer le polygone.
S’applique à
AddPolygon(ReadOnlySpan<PointF>)
- Source:
- GraphicsPath.cs
- 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))
Paramètres
- points
- ReadOnlySpan<PointF>
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour