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

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

        public static Bitmap HLine(int x1, int x2, int y, Color color)
        {
            Bitmap image = new Bitmap(250, 250);

            for (int count = x1; count <= x2; count++)
                image.SetPixel(count, y, color);
            return image;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            pictureBox1.Image = HLine(50, 200, 100, Color.Black);
        }
    }
}