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

namespace _ex_12_2
{
    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);

            Point[] points =
            {
                new Point(10, 10), new Point(10, 50),
                new Point(100, 50), new Point(150, 100)
            };

            graph1.DrawLines(pen1, points);

            pictureBox1.Image = image1;
        }
    }
}