示例#1
0
        private void button12_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(640, 480);

            if (pictureBox1.Image != null)
            {
                bmp = (Bitmap)pictureBox1.Image.Clone();
            }
            circunferencia v  = new circunferencia();
            double         x  = -10;
            double         dx = 0.3;

            do
            {
                v.x0   = x;
                v.RD   = 0.4;
                v.y0   = x + 2;
                v.col0 = Color.Blue;
                v.EncenderC(ref bmp);
                pictureBox1.Refresh();
                Thread.Sleep(100);
                v.ApagarC(ref bmp);
                pictureBox1.Image = bmp;
                x = x + dx;
            } while (x <= 10);
        }
示例#2
0
        private void button13_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(640, 480);

            if (pictureBox1.Image != null)
            {
                bmp = (Bitmap)pictureBox1.Image.Clone();
            }
            circunferencia cir = new circunferencia();
            double         x, dx;

            x  = 0;
            dx = 0.3;
            do
            {
                cir.col0 = Color.Blue;
                cir.x0   = x - 10;
                cir.y0   = -x * (x - 5);
                cir.EncenderC(ref bmp);
                pictureBox1.Refresh();
                Thread.Sleep(100);
                cir.ApagarC(ref bmp);
                pictureBox1.Image = bmp;
                x = x + dx;
            } while (x <= 5);

            //x = 0;
            //dx = 0.3;
            //do
            //{

            //    cir.col0 = Color.Blue;
            //    cir.x0 = x - 5;
            //    cir.y0 = (-x * (x - 5)) / 1.5;
            //    cir.EncenderC(ref bmp);
            //    pictureBox1.Refresh();
            //    Thread.Sleep(100);
            //    cir.ApagarC(ref bmp);
            //    pictureBox1.Image = bmp;
            //    x = x + dx;
            //} while (x <= 5);

            //x = 0;
            //dx = 0.3;
            //do
            //{
            //    cir.col0 = Color.White;
            //    cir.x0 = x;
            //    cir.y0 = (-x * (x - 5)) / 2;
            //    cir.EncenderC(ref bmp);
            //    pictureBox1.Refresh();
            //    Thread.Sleep(100);
            //    cir.ApagarC(ref bmp);
            //    pictureBox1.Image = bmp;
            //    x = x + dx;
            //} while (x <= 5);

            //x = 0;
            //dx = 0.3;
            //do
            //{
            //    cir.col0 = Color.White;
            //    cir.x0 = x + 5;
            //    cir.y0 = (-x * (x - 5)) / 3;
            //    cir.EncenderC(ref bmp);
            //    pictureBox1.Refresh();
            //    Thread.Sleep(100);
            //    cir.ApagarC(ref bmp);
            //    pictureBox1.Image = bmp;
            //    x = x + dx;
            //} while (x <= 5);
        }