protected override void OnMouseUp(MouseEventArgs e) { if (cur != null) { if (cur.Bound.IntersectsWith(_map.Bound)) { //add _map.Add(cur.Img, cur.Bound.Location); } } _isMouseDown = false; cur = null; base.OnMouseUp(e); _map.OnMouseUp(e); this.Invalidate(false); }
protected override void OnMouseDown(MouseEventArgs e) { cur = null; _isMouseDown = true; foreach (var img in imageBounds) { if (img.Bound.Contains(e.Location)) { cur = new ImageBound() { Img = img.Img, Location = img.Location }; break; } } _lastMouseLocation = e.Location; base.OnMouseDown(e); _map.OnMouseDown(e); this.Invalidate(false); }