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); } }
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; } }