سلام
پيشنهاد ميكنم از متد AddRectangles استفاده كنيد. كد زير را ببينيد:
///<summary>
/// GraphicsPath.AddRectangles Method (Rectangle[])
///
/// The following code example is designed for use with Windows Forms,
/// and it requires PaintEventArgse, an OnPaint event object. The code
/// performs the following actions:
/// o Creates a path.
/// o Creates an array of rectangles and adds the rectangles to the path.
/// o Draws the path to the screen.
///</summary>
///<param name="e"></paramAddRectangles Method>
privatevoid AddRectanglesExample(PaintEventArgs e)
{
// Adds a pattern of rectangles to a GraphicsPath object.
GraphicsPath myPath = newGraphicsPath();
Rectangle[] pathRects =
{
newRectangle(20,20,100,200),
newRectangle(40,40,120,220),
newRectangle(60,60,240,140)
};
myPath.AddRectangles(pathRects);
// Draw the path to the screen.
Pen myPen = newPen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}