Graphics g = this.CreateGraphics(); Pen pen = new Pen(Color.Black); g.DrawRectangle(pen, 10, 10, 100, 50);
Graphics g = this.CreateGraphics(); SolidBrush brush = new SolidBrush(Color.Red); g.FillRectangle(brush, 20, 20, 50, 75);In both examples, the package library being used is the System.Drawing namespace, which provides a set of classes for working with graphics in C# applications.