GraphicsPath.AddRectangles 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 une série de rectangles à ce chemin d’accès.
Surcharges
AddRectangles(Rectangle[]) |
Ajoute une série de rectangles à ce chemin d’accès. |
AddRectangles(RectangleF[]) |
Ajoute une série de rectangles à ce chemin d’accès. |
AddRectangles(ReadOnlySpan<Rectangle>) | |
AddRectangles(ReadOnlySpan<RectangleF>) |
AddRectangles(Rectangle[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Ajoute une série de rectangles à ce chemin d’accès.
public:
void AddRectangles(cli::array <System::Drawing::Rectangle> ^ rects);
public void AddRectangles (System.Drawing.Rectangle[] rects);
member this.AddRectangles : System.Drawing.Rectangle[] -> unit
Public Sub AddRectangles (rects As Rectangle())
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 chemin d’accès.
Crée un tableau de rectangles et ajoute les rectangles au chemin d’accès.
Dessine le chemin d’accès à l’écran.
private:
void AddRectanglesExample( PaintEventArgs^ e )
{
// Adds a pattern of rectangles to a GraphicsPath object.
GraphicsPath^ myPath = gcnew GraphicsPath;
array<Rectangle>^ pathRects = {Rectangle(20,20,100,200),Rectangle(40,40,120,220),Rectangle(60,60,240,140)};
myPath->AddRectangles( pathRects );
// Draw the path to the screen.
Pen^ myPen = gcnew Pen( Color::Black,2.0f );
e->Graphics->DrawPath( myPen, myPath );
}
private void AddRectanglesExample(PaintEventArgs e)
{
// Adds a pattern of rectangles to a GraphicsPath object.
GraphicsPath myPath = new GraphicsPath();
Rectangle[] pathRects =
{
new Rectangle(20,20,100,200),
new Rectangle(40,40,120,220),
new Rectangle(60,60,240,140)
};
myPath.AddRectangles(pathRects);
// Draw the path to the screen.
Pen myPen = new Pen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddRectanglesExample(ByVal e As PaintEventArgs)
' Adds a pattern of rectangles to a GraphicsPath object.
Dim myPath As New GraphicsPath
Dim pathRects As Rectangle() = {New Rectangle(20, 20, 100, 200), _
New Rectangle(40, 40, 120, 220), New Rectangle(60, 60, 240, 140)}
myPath.AddRectangles(pathRects)
' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub
S’applique à
AddRectangles(RectangleF[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Ajoute une série de rectangles à ce chemin d’accès.
public:
void AddRectangles(cli::array <System::Drawing::RectangleF> ^ rects);
public:
void AddRectangles(... cli::array <System::Drawing::RectangleF> ^ rects);
public void AddRectangles (System.Drawing.RectangleF[] rects);
public void AddRectangles (params System.Drawing.RectangleF[] rects);
member this.AddRectangles : System.Drawing.RectangleF[] -> unit
Public Sub AddRectangles (rects As RectangleF())
Public Sub AddRectangles (ParamArray rects As RectangleF())
Paramètres
- rects
- RectangleF[]
Tableau de structures RectangleF qui représente les rectangles à ajouter.
Exemples
Pour obtenir un exemple, consultez AddRectangles(Rectangle[]).
S’applique à
AddRectangles(ReadOnlySpan<Rectangle>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
void AddRectangles(ReadOnlySpan<System::Drawing::Rectangle> rects);
public void AddRectangles (ReadOnlySpan<System.Drawing.Rectangle> rects);
member this.AddRectangles : ReadOnlySpan<System.Drawing.Rectangle> -> unit
Public Sub AddRectangles (rects As ReadOnlySpan(Of Rectangle))
Paramètres
- rects
- ReadOnlySpan<Rectangle>
S’applique à
AddRectangles(ReadOnlySpan<RectangleF>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
void AddRectangles(ReadOnlySpan<System::Drawing::RectangleF> rects);
public void AddRectangles (ReadOnlySpan<System.Drawing.RectangleF> rects);
member this.AddRectangles : ReadOnlySpan<System.Drawing.RectangleF> -> unit
Public Sub AddRectangles (rects As ReadOnlySpan(Of RectangleF))
Paramètres
- rects
- ReadOnlySpan<RectangleF>
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour