Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Polygon2 triangle = new Polygon2(3);

            triangle[0] = new Point(10, 10);
            triangle[1] = new Point(50, 50);
            triangle[2] = new Point(10, 70);
            MessageBox.Show(triangle[2].ToString());
        }
Exemple #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Polygon2 rect = new Polygon2(4);

            rect[0] = new Point(10, 10);
            rect[1] = new Point(80, 10);
            rect[2] = new Point(80, 130);
            rect[3] = new Point(10, 130);
            rect.Draw(this.CreateGraphics(), Color.Red);
        }