/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void GLTileControl_MouseWheel(object sender, MouseEventArgs e) { if (e.Delta > 0) { ZoomInButton.PerformClick(); } else if (e.Delta < 0) { ZoomOutButton.PerformClick(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void GLTextureControl_MouseWheel(object sender, MouseEventArgs e) { if (e.Delta > 0) { ZoomInButton.PerformClick(); } else if (e.Delta < 0) { ZoomOutButton.PerformClick(); } Point loc = e.Location; int zoomvalue = int.Parse((string)ZoomBox.SelectedItem); Point point = new Point(((e.Location.X - TextureOffset.X) / zoomvalue) - loc.X, (int)((e.Location.Y - TextureOffset.Y) / zoomvalue) - loc.Y); Point point2 = new Point(((e.Location.X - TextureOffset.X) / zoomvalue), (int)((e.Location.Y - TextureOffset.Y) / zoomvalue)); // TextureOffset.Offset(point); }