Beispiel #1
0
        private void Dibuja(int x, int y, bool Decision)
        {
            Rectangle[] Aux = new Rectangle[Rectangulos.Length + 1];
            int         au  = 0;

            if (Decision && x != 1000)
            {
                int Ejex = this.Location.X + gbInfoTatuajes.Location.X + ptbPerfil.Location.X + 4;
                int Ejey = this.Location.Y + gbInfoTatuajes.Location.Y + ptbPerfil.Location.Y + 4;

                Ejex = x - Ejex;
                Ejey = y - Ejey;

                Graphics ObjGrafico;
                ObjGrafico = ptbPerfil.CreateGraphics();
                Pen       Pluma        = new Pen(System.Drawing.Color.Red, 5);
                Rectangle MiRectangulo = new Rectangle(Ejex, Ejey, 5, 5);
                ObjGrafico.DrawEllipse(Pluma, MiRectangulo);

                for (int i = 0; i < Rectangulos.Length; i++)
                {
                    Aux[i] = Rectangulos[i];
                    au     = i + 1;
                }
                Aux[au] = MiRectangulo;

                Rectangulos = new Rectangle[Aux.Length];
                for (int i = 0; i < Rectangulos.Length; i++)
                {
                    Rectangulos[i] = Aux[i];
                }
            }
            else if (x == 1000)
            {
                for (int i = 0; i < Rectangulos.Length; i++)
                {
                    Graphics ObjGrafico;
                    ObjGrafico = ptbPerfil.CreateGraphics();
                    Pen       Pluma        = new Pen(System.Drawing.Color.Red, 5);
                    Rectangle MiRectangulo = new Rectangle(Rectangulos[i].X, Rectangulos[i].Y, 5, 5);
                    ObjGrafico.DrawEllipse(Pluma, MiRectangulo);
                }
            }
            else
            {
                EliminarPunto();
            }
        }
Beispiel #2
0
 private void EliminarPunto()
 {
     if (Rectangulos.Length == 0)
     {
     }
     else
     {
         Rectangle[] aux = new Rectangle[Rectangulos.Length - 1];
         for (int i = 0; i < aux.Length; i++)
         {
             aux[i] = Rectangulos[i];
             Graphics ObjGrafico;
             ObjGrafico = ptbPerfil.CreateGraphics();
             Pen       Pluma        = new Pen(System.Drawing.Color.Red, 5);
             Rectangle MiRectangulo = new Rectangle(aux[i].X, aux[i].Y, 5, 5);
             ObjGrafico.DrawEllipse(Pluma, MiRectangulo);
         }
         Rectangulos = new Rectangle[aux.Length];
         for (int i = 0; i < Rectangulos.Length; i++)
         {
             Rectangulos[i] = aux[i];
         }
     }
 }