Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
Namespace:
Aurigma.GraphicsMill.Drawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public void FillRectangle( Brush brush, int x, int y, int width, int height )
Type: Aurigma.GraphicsMill.Drawing.Brush
A Brush that determines the characteristics of the fill.Type: System.Int32
The x-coordinate of the upper-left corner of the rectangle to fill.Type: System.Int32
The x-coordinate of the upper-left corner of the rectangle to fill.Type: System.Int32
The width of the rectangle to fill.Type: System.Int32
The height of the rectangle to fill.To outline a rectangle, use DrawRectangle(Pen, Int32, Int32, Int32, Int32) method.
using (var bitmap = new Bitmap(185, 145, PixelFormat.Format24bppRgb, RgbColor.White)) { using (Graphics graphics = bitmap.GetGraphics()) { //Draw filled and outlined rectangle var pen = new Pen(RgbColor.Red, 3); var brush = new SolidBrush(RgbColor.Lavender); graphics.FillRectangle(brush, 10, 10, 100, 60); graphics.DrawRectangle(pen, 10, 10, 100, 60); //Draw filled but non-outlined ellipse brush.Color = RgbColor.Yellow; graphics.FillEllipse(brush, 60, 40, 100, 80); //Draw outlined but non-filled polygon pen.Color = RgbColor.Green; pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; pen.Width = 2; System.Drawing.Point[] points = { new System.Drawing.Point(20, 30), new System.Drawing.Point(50, 2), new System.Drawing.Point(180, 30), new System.Drawing.Point(80, 140) }; graphics.DrawPolygon(pen, points); } bitmap.Save(@"Images\Output\shapesGDI.png"); }