using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

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

            Point[] points =
            {
                new Point(50, 50), new Point(30, 70), new Point(70, 70)
            };

            graph1.DrawPolygon(pen1, points);

            pictureBox1.Image = image1;
        }
    }
}