void HandleMouseWheel(object sender, MouseEventArgs e) { Ray pointer = viewport.GetPointerRay(e.Location); viewport.Zoom(pointer, -e.Delta / 120); this.Invalidate(); }
void UserControl1_MouseWheel(object sender, MouseEventArgs e) { //viewport.zoom(e.Delta / 120); //Vector2 location = viewport.TransformToViewport(ClientRectangle, e.Location); viewport.Zoom(new Vector2(e.Location.X, e.Location.Y), -e.Delta / 120); this.Invalidate(); }