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

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

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

            Graphics graph1 = Graphics.FromImage(image1);

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

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

            Pen pen1 = new Pen(Color.Blue, 5);

            float x = 10, y = 10, width = 80, height = 50;

            graph1.DrawRectangle(pen1, x, y, width, height);

            pictureBox1.Image = image1;
        }
    }
}