示例#1
0
文件: Form1.cs 项目: Topru333/Graphs
 private void Form1_Load(object sender, EventArgs e)
 {
     g = new Graphs(pictureBox1);
 }
示例#2
0
文件: Form2.cs 项目: Topru333/Graphs
        private void BonusLines(Point A, Point B, Point C, PaintEventArgs e)
        {
            int w = rnd.Next(1, 4);

            if (checkBox1.Checked)
            {
                int procent = rnd.Next(1, 21);
                if (w == 1)
                {
                    Point T = Graphs.RotatePoint(Center, A, 180);

                    e.Graphics.DrawLine(Pens.Black, A, T);
                    e.Graphics.DrawLine(Pens.Black, B, T);
                    e.Graphics.DrawLine(Pens.Black, C, T);
                }
                else if (w == 2)
                {
                    Point T = Graphs.RotatePoint(Center, B, 180);
                    e.Graphics.DrawLine(Pens.Black, A, T);
                    e.Graphics.DrawLine(Pens.Black, B, T);
                    e.Graphics.DrawLine(Pens.Black, C, T);
                }
                else if (w == 3)
                {
                    Point T = Graphs.RotatePoint(Center, C, 180);
                    e.Graphics.DrawLine(Pens.Black, A, T);
                    e.Graphics.DrawLine(Pens.Black, B, T);
                    e.Graphics.DrawLine(Pens.Black, C, T);
                }
            }
            else if (checkBox2.Checked)
            {
                if (w == 1)
                {
                    Point T = Graphs.RotatePoint(Center, A, 180);
                    e.Graphics.DrawLine(Pens.Black, A, T);
                    e.Graphics.DrawLine(Pens.Black, B, T);
                    e.Graphics.DrawLine(Pens.Black, C, T);
                    Point R = Graphs.RotatePoint(Center, B, 180);
                    e.Graphics.DrawLine(Pens.Black, A, R);
                    e.Graphics.DrawLine(Pens.Black, B, R);
                    e.Graphics.DrawLine(Pens.Black, C, R);

                    e.Graphics.DrawLine(Pens.Black, T, R);
                }
                else if (w == 2)
                {
                    Point T = Graphs.RotatePoint(Center, B, 180);
                    e.Graphics.DrawLine(Pens.Black, A, T);
                    e.Graphics.DrawLine(Pens.Black, B, T);
                    e.Graphics.DrawLine(Pens.Black, C, T);
                    Point R = Graphs.RotatePoint(Center, C, 180);
                    e.Graphics.DrawLine(Pens.Black, A, R);
                    e.Graphics.DrawLine(Pens.Black, B, R);
                    e.Graphics.DrawLine(Pens.Black, C, R);

                    e.Graphics.DrawLine(Pens.Black, T, R);
                }
                else if (w == 3)
                {
                    Point T = Graphs.RotatePoint(Center, C, 180);
                    e.Graphics.DrawLine(Pens.Black, A, T);
                    e.Graphics.DrawLine(Pens.Black, B, T);
                    e.Graphics.DrawLine(Pens.Black, C, T);
                    Point R = Graphs.RotatePoint(Center, A, 180);
                    e.Graphics.DrawLine(Pens.Black, A, R);
                    e.Graphics.DrawLine(Pens.Black, B, R);
                    e.Graphics.DrawLine(Pens.Black, C, R);

                    e.Graphics.DrawLine(Pens.Black, T, R);
                }
            }
            else if (checkBox3.Checked)
            {
                Point T = Graphs.RotatePoint(Center, A, 180);
                e.Graphics.DrawLine(Pens.Black, A, T);
                e.Graphics.DrawLine(Pens.Black, B, T);
                e.Graphics.DrawLine(Pens.Black, C, T);
                Point R = Graphs.RotatePoint(Center, B, 180);
                e.Graphics.DrawLine(Pens.Black, A, R);
                e.Graphics.DrawLine(Pens.Black, B, R);
                e.Graphics.DrawLine(Pens.Black, C, R);
                Point U = Graphs.RotatePoint(Center, C, 180);
                e.Graphics.DrawLine(Pens.Black, A, U);
                e.Graphics.DrawLine(Pens.Black, B, U);
                e.Graphics.DrawLine(Pens.Black, C, U);

                e.Graphics.DrawLine(Pens.Black, T, R);
                e.Graphics.DrawLine(Pens.Black, U, R);
                e.Graphics.DrawLine(Pens.Black, T, U);
            }
        }