Draws a number of rectangles specified by an array of RectangleF structures.
Namespace:
Aurigma.GraphicsMill.AdvancedDrawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public void DrawRectangles( Pen pen, RectangleF[] rectangles )
Type: Aurigma.GraphicsMill.AdvancedDrawing.Pen
A Pen that determines the color, width, and style of the rectangle.Type: System.Drawing.RectangleF[]
An array of RectangleF structures that represents the rectangles to draw.To draw filled rectangles, use FillRectangles(Brush, RectangleF[]) method.
using (var bitmap = new Bitmap(200, 80, PixelFormat.Format24bppRgb, RgbColor.White)) { var graphics = bitmap.GetAdvancedGraphics(); System.Drawing.RectangleF[] rectangles = { new System.Drawing.RectangleF(10, 60, 10, 60), new System.Drawing.RectangleF(40, 20, 10, 60), new System.Drawing.RectangleF(70, 60, 10, 60), new System.Drawing.RectangleF(130, 60, 10, 60), new System.Drawing.RectangleF(160, 20, 10, 60), new System.Drawing.RectangleF(190, 60, 10, 60), new System.Drawing.RectangleF(40, 20, 10, 60)}; graphics.DrawRectangles(new Pen(RgbColor.Black), rectangles); bitmap.Save(@"Images\Output\out.png"); }