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

namespace _ex_12_1
{
    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.Red, 5);

            float x1 = 50, y1 = 50, x2 = 150, y2 = 50;

            graph1.DrawLine(pen1, x1, y1, x2, y2);

            pictureBox1.Image = image1;
        }
    }
}