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

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

        public static Bitmap FillRectangle(int x0, int y0,
                                           int x1, int y1)
        {
            Bitmap image = new Bitmap(250, 250);
            int i, j;
            
            for (i = x0; i <= x1; i++)
                for (j = y0; j <= y1; j++)
                    image.SetPixel(i, j, Color.Red);
            
            return image;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int x0 = Convert.ToInt32(textBox1.Text);
            int y0 = Convert.ToInt32(textBox2.Text);
            
            int x1 = Convert.ToInt32(textBox3.Text);
            int y1 = Convert.ToInt32(textBox4.Text);
            
            pictureBox1.Image = FillRectangle(x0, y0, x1, y1);
        }
    }
}