Ejemplo n.º 1
0
        private void ShapePictureBox_Paint(object sender, PaintEventArgs e)
        {
            if (figure != null && press && !user)
            {
                CountCanvasPoints();
                figure.DrawE(one, two, e);
            }
            if (customShape != null && user && press)
            {
//                CustomShape customShape = new CustomShape("CUSTOMSHAPE",ListOfUserShapes,ShapePictureBox.Width,ShapePictureBox.Height);
                customShape.DrawE(one, two, e);
//                CountCanvasPoints();
//                foreach (Shape figure in ListOfUserShapes)
//                {

                /*
                 * int newX1 = one.X + (two.X - one.X) * figure.pos1.X / ShapePictureBox.Width;//MaxP.X - MinP.X
                 * int newY1 = one.Y + (two.Y - one.Y) * figure.pos1.Y / ShapePictureBox.Height;//MaxP.Y - MinP.Y
                 * int newX2 = one.X + (two.X - one.X) * Math.Abs(figure.pos2.X - figure.pos1.X) / ShapePictureBox.Width;
                 * int newY2 = one.Y + (two.Y - one.Y) * Math.Abs(figure.pos2.Y - figure.pos1.Y) / ShapePictureBox.Height;
                 */
                /*
                 * x = one.X + (figure.pos1.X - 0) * (two.X - one.X) / (ShapePictureBox.Width - 0);
                 * y = one.Y + (figure.pos1.Y - 0) * (two.Y - one.Y) / (ShapePictureBox.Height - 0);
                 * h = x + (figure.pos2.X - figure.pos1.X) * (two.X - one.X) / (ShapePictureBox.Width - 0);
                 * w = y + (figure.pos2.Y - figure.pos1.Y) * (two.Y - one.Y) / (ShapePictureBox.Height - 0);
                 */
//                    figure.DrawE(one, two, e);
//                }
            }
        }
Ejemplo n.º 2
0
 private void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
     if (temp != null && press)
     {
         //  if (!(temp is DrawPencil))
         temp.DrawE(one, two, e);
     }
 }