using System;
using System.Drawing;
using System.Windows.Forms;

namespace _12_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Bitmap image1 = new Bitmap(this.Width, this.Height);

            Graphics graph1 = Graphics.FromImage(image1);

            graph1.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            graph1.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

            SolidBrush brush1 = new SolidBrush(Color.Red);

            graph1.FillRectangle(brush1, 20, 20, 150, 130);

            Pen pen1 = new Pen(Color.Black, 1);

            graph1.DrawRectangle(pen1, 20, 20, 150, 130);

            brush1.Color = Color.FromArgb(150, 255, 255, 0);

            graph1.FillRectangle(brush1, 40, 40, 150, 130);

            graph1.DrawRectangle(pen1, 40, 40, 150, 130);

            graph1.DrawLine(pen1, 20, 20, 40, 40);

            graph1.DrawLine(pen1, 170, 20, 190, 40);

            graph1.DrawLine(pen1, 20, 150, 40, 170);

            graph1.DrawLine(pen1, 170, 150, 190, 170);

            this.BackgroundImage = image1;
        }
    }
}