コード例 #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 circulos_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(640, 480);

            if (pictureBox1.Image != null)
            {
                bmp = (Bitmap)pictureBox1.Image.Clone();
            }

            circunferencia c = new circunferencia();

            c.x0   = 3;
            c.y0   = 3;
            c.RD   = 3;
            c.col0 = Color.Red;


            c.EncenderC(ref bmp);
            pictureBox1.Image = bmp;

            c.x0   = 3;
            c.y0   = 3;
            c.RD   = 5;
            c.col0 = Color.Red;



            c.EncenderC(ref bmp);
            pictureBox1.Image = bmp;
        }
コード例 #3
0
        private void button11_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(640, 480);

            if (pictureBox1.Image != null)
            {
                bmp = (Bitmap)pictureBox1.Image.Clone();
            }
            vector         v = new vector();
            circunferencia c = new circunferencia();

            float x  = -9;
            float dx = 0.003f;

            c.RD = 0.3;

            do
            {
                v.x0   = (x);
                v.y0   = Math.Pow(0.5, x);
                v.col0 = Color.Green;
                v.proceso_encender(ref bmp);
                v.y0   = 1 + x * Math.Log(0.5) + (Math.Pow(x, 2) * Math.Pow(Math.Log(0.5), 2)) / 2 + (Math.Pow(x, 3) * Math.Pow(Math.Log(0.5), 3)) / 6 + (Math.Pow(x, 4) * Math.Pow(Math.Log(0.5), 4)) / 24 + (Math.Pow(x, 5) * Math.Pow(Math.Log(0.5), 5)) / 120;
                v.col0 = Color.Black;
                v.proceso_encender(ref bmp);
                pictureBox1.Image = bmp;
                x = x + dx;
            } while (x <= 9);
        }
コード例 #4
0
        private void button23_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(640, 480);

            if (pictureBox1.Image != null)
            {
                bmp = (Bitmap)pictureBox1.Image.Clone();
            }
            int    R, G, B;
            Random md = new Random();

            for (int i = 0; i < 16; i++)
            {
                R          = (int)md.Next(1, 255);
                G          = (int)md.Next(1, 255);
                B          = (int)md.Next(1, 255);
                paleta2[i] = Color.FromArgb(R, G, B);
            }


            circunferencia c = new circunferencia();

            c.x0   = 3;
            c.y0   = 3;
            c.RD   = 3;
            c.col0 = Color.Red;


            c.EncenderC(ref bmp);
            pictureBox1.Image = bmp;
        }
コード例 #5
0
        private void button5_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(640, 480);
            //segmento s = new segmento();
            //s.X0 = -5;
            //s.Y0 = 2;
            //s.xf = -5;
            //s.yf = -4;
            //s.encender(ref bmp);
            //segmento s2 = new segmento();
            //s2.X0 = -4;
            //s2.Y0 = -5;
            //s2.xf = 4;
            //s2.yf = 5;
            //s2.encender(ref bmp);
            //segmento2(-5, 2, -5, -4, ref bmp);
            //segmento2(5, 2, 5, -4, ref bmp);
            //segmento2(-5, -4, 5, -4, ref bmp);
            //segmento2(-5, 2, 5, 2, ref bmp);
            //segmento2(-5, -4, 5, 2, ref bmp);
            //segmento2(5, -4, -5, 2, ref bmp);
            //segmento2(-5, 2, 0, 6, ref bmp);
            //segmento2(5, 2, 0, 6, ref bmp);
            //segmento2(6, -2, 6, -4, ref bmp);
            //segmento2(-10, -7.5, 10, 7.5, ref bmp);



            //circunferencia arriba
            circunferencia c = new circunferencia();

            c.x0 = 0;
            c.y0 = 4;
            c.RD = 1;
            c.EncenderC(ref bmp);
            //circunferencia lado
            circunferencia c2 = new circunferencia();

            c2.x0 = 5;
            c2.y0 = 0;
            c2.RD = 1;
            // c2.EncenderC(ref bmp);
            //lazo abajo
            lazo l = new lazo();

            l.x0 = 6;
            l.y0 = -2;
            l.RD = 0.5;
            l.encender_lazo(ref bmp);
            //  pictureBox1.Image = bmp;
            //lazo lateral
            lazo l2 = new lazo();

            l2.x0 = -4;
            l2.y0 = 0;
            l2.RD = 2;
            //l2.encender_lazo(ref bmp);
            // pictureBox1.Image = bmp;
        }
コード例 #6
0
        private void button4_Click(object sender, EventArgs e)
        {
            Bitmap         bmp = new Bitmap(640, 480);
            circunferencia c   = new circunferencia();


            c.x0 = -3;
            c.y0 = 1;
            c.RD = 4;


            c.EncenderC(ref bmp);
            pictureBox1.Image = bmp;
        }
コード例 #7
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);
        }