Exemple #1
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            reloj rj = new reloj();

            int centroX = this.Width / 2,
                centroY = this.Height / 2,
                mDig    = (rj._tamaño * 12);

            Digito[] d = new Digito[4];

            for (int dig = 3; dig > 0; dig++)
            {
                d[dig] = new Digito(rj, centroX - mDig * dig - 1, 200);
            }



            d[0].numero(1);
            d[1].numero(2);
            d[3].numero(3);
            d[4].numero(4);

            timer1.Enabled = true;
            timer1.Start();
        }
Exemple #2
0
        public void digito(Digito dg, int a, int b, int c, int d, int e, int f, int g)
        {
            int tam = this.tamaño * 10, x = dg._Dx - (tam / 2), y = dg._Dy - tam,
                x2 = x + tam, y2 = y + tam, y3 = y + (tam * 2),
                tamRect = tam / 20,
                gr = tamRect * 4, inc = 8;

            if (this.guias == true)
            {
                posRects(x, y, tam, tamRect, Color.FromArgb(255, 0, 0));
            }

            if (a == 1)
            {
                linea(x + tamRect + inc, y, x2 - tamRect + inc, y, gr, dg.cl);        //a
            }
            if (b == 1)
            {
                linea(x2 + inc, y + tamRect, x2, y2 - tamRect, gr, dg.cl);        //b
            }
            if (c == 1)
            {
                linea(x2, y2 + tamRect, x2 - inc, y3 - tamRect, gr, dg.cl);        //c
            }
            if (d == 1)
            {
                linea(x + tamRect - inc, y3, x2 - tamRect - inc, y3, gr, dg.cl);        //d
            }
            if (e == 1)
            {
                linea(x - inc, y3 - tamRect, x, y2 + tamRect, gr, dg.cl);        //e
            }
            if (f == 1)
            {
                linea(x, y2 - tamRect, x + inc, y + tamRect, gr, dg.cl);        //f
            }
            if (g == 1)
            {
                linea(x + tamRect, y2, x2 - tamRect, y2, gr, dg.cl);        //g
            }
        }