Code:
Creating a pen
Or:
Drawing a line:
Drawing a circle:
Drawing a rectangle:
Creating a brush:
Or:
Drawing text:
Filling circle;
Filling rectangle:
Creating a pen
Pen p = new Pen(Color.Blue, 5);
Or:
Pen p = Pens.Blue;
Drawing a line:
e.Graphics.DrawLine(p, X1, Y1, X2, Y2);
Drawing a circle:
e.Graphics.DrawEllipse(p, X, Y, WIDTH, HEIGHT);
Drawing a rectangle:
e.Graphics.DrawRectangle(p, X, Y, WIDTH, HEIGHT):
Creating a brush:
Brush b = new SolidBrush(Color.Black);
Or:
Brush b = Brushes.Black;
Drawing text:
Font f = new Font("Segoe UI", 15, FontStyle.Italic | FontStyle.Bold); e.Graphics.DrawString("YOUR TEXT HERE", f, b, X, Y);
Filling circle;
e.Graphics.FillEllipse(b, X, Y, WIDTH, HEIGHT);
Filling rectangle:
e.Graphics.FillRectangle(b, X, Y, WIDTH, HEIGHT);