GraphicsPath.AddRectangles Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menambahkan serangkaian persegi panjang ke jalur ini.
Overload
AddRectangles(Rectangle[]) |
Menambahkan serangkaian persegi panjang ke jalur ini. |
AddRectangles(RectangleF[]) |
Menambahkan serangkaian persegi panjang ke jalur ini. |
AddRectangles(ReadOnlySpan<Rectangle>) | |
AddRectangles(ReadOnlySpan<RectangleF>) |
AddRectangles(Rectangle[])
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
Menambahkan serangkaian persegi panjang ke jalur ini.
public:
void AddRectangles(cli::array <System::Drawing::Rectangle> ^ rects);
public:
void AddRectangles(... cli::array <System::Drawing::Rectangle> ^ rects);
public void AddRectangles (System.Drawing.Rectangle[] rects);
public void AddRectangles (params System.Drawing.Rectangle[] rects);
member this.AddRectangles : System.Drawing.Rectangle[] -> unit
Public Sub AddRectangles (rects As Rectangle())
Public Sub AddRectangles (ParamArray rects As Rectangle())
Parameter
Contoh
Contoh kode berikut dirancang untuk digunakan dengan Windows Forms, dan memerlukan PaintEventArgse
, objek peristiwa OnPaint. Kode melakukan tindakan berikut:
Membuat jalur.
Membuat array persegi panjang dan menambahkan persegi panjang ke jalur.
Menggambar jalur ke layar.
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
Berlaku untuk
AddRectangles(RectangleF[])
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
Menambahkan serangkaian persegi panjang ke jalur ini.
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())
Parameter
- rects
- RectangleF[]
Array struktur RectangleF yang mewakili persegi panjang untuk ditambahkan.
Contoh
Misalnya, lihat AddRectangles(Rectangle[]).
Berlaku untuk
AddRectangles(ReadOnlySpan<Rectangle>)
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
public:
void AddRectangles(ReadOnlySpan<System::Drawing::Rectangle> rects);
public void AddRectangles (scoped ReadOnlySpan<System.Drawing.Rectangle> rects);
member this.AddRectangles : ReadOnlySpan<System.Drawing.Rectangle> -> unit
Public Sub AddRectangles (rects As ReadOnlySpan(Of Rectangle))
Parameter
- rects
- ReadOnlySpan<Rectangle>
Berlaku untuk
AddRectangles(ReadOnlySpan<RectangleF>)
- Sumber:
- GraphicsPath.cs
- Sumber:
- GraphicsPath.cs
public:
void AddRectangles(ReadOnlySpan<System::Drawing::RectangleF> rects);
public void AddRectangles (scoped ReadOnlySpan<System.Drawing.RectangleF> rects);
member this.AddRectangles : ReadOnlySpan<System.Drawing.RectangleF> -> unit
Public Sub AddRectangles (rects As ReadOnlySpan(Of RectangleF))
Parameter
- rects
- ReadOnlySpan<RectangleF>