示例#1
0
        private void B1_Click(object sender, EventArgs e)
        {
            TextBox t1 = FindControl(panel1, "t1") as TextBox;
            int     angle;

            int.TryParse(t1.Text, out angle);
            if (Mode == 0)
            {
                Label l11 = FindControl(panel1, "l11") as Label;
                Label l12 = FindControl(panel1, "l12") as Label;
                int   x;
                int   y;
                int.TryParse(l11.Text.Split(' ')[1], out x);
                int.TryParse(l12.Text.Split(' ')[1], out y);
                if (!(FindControl(panel1, "cb1") as CheckBox).Checked)
                {
                    f = Figure.RotationPoint(f, new CustomPoint(x, y), angle);
                }
                else
                {
                    f = Figure.RotationLine(f, 90);
                }
            }
            else
            {
                f = Figure.Rotation(f, angle);
            }

            RedrawPolygon(f);
        }