Esempio n. 1
0
 private void image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (factory != null)
     {
         shape = factory.Create(bitmap, color);
         Point p = e.GetPosition(image);
         shape.X1 = (int)Math.Round(p.X);
         shape.Y1 = (int)Math.Round(p.Y);
     }
 }
Esempio n. 2
0
        private void image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (shape != null)
            {
                //SaveOld(bitmap);

                Point p = e.GetPosition(image);
                shape.X2 = (int)Math.Round(p.X);
                shape.Y2 = (int)Math.Round(p.Y);

                shape.AdjustCoordinates();

                shape.Draw();
                UpdateImage(bitmap);

                shape = null;
            }
        }