private void MouseDownCanvasEvent(Object sender, MouseEventArgs e) { if (Started && e.Button == MouseButtons.Left && (BoxCreated == false || !InsideBox(e))) { MouseDrawing = true; MouseDownX = e.X; MouseDownY = e.Y; } else if (e.Button == MouseButtons.Left && BoxCreated && InsideBox(e)) { BoxMoving = true; BoxOffsetX = Box.Item1 - e.X; //- Outline.Location.X; BoxOffsetY = Box.Item2 - e.Y; //- Outline.Location.Y; } else if (PreviousZooms.Count > 0) { BoxCreated = false; Tuple <double, double, double, double> Zoom = PreviousZooms.Pop(); StartX = Zoom.Item1; StartY = Zoom.Item2; RangeX = Zoom.Item3; RangeY = Zoom.Item4; dx = RangeX / PicCanvas.ClientSize.Width; dy = RangeY / PicCanvas.ClientSize.Height; Start("Zooming Out"); } }
private void MouseDownForm(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && PreviousZooms.Count > 0) { BoxCreated = false; Tuple <double, double, double, double> Zoom = PreviousZooms.Pop(); StartX = Zoom.Item1; StartY = Zoom.Item2; RangeX = Zoom.Item3; RangeY = Zoom.Item4; dx = RangeX / PicCanvas.ClientSize.Width; dy = RangeY / PicCanvas.ClientSize.Height; Start("Zooming Out"); } }