ImageGlass.ImageBox.OnMouseWheel C# (CSharp) Method

OnMouseWheel() protected method

Raises the System.Windows.Forms.Control.MouseWheel event.
protected OnMouseWheel ( MouseEventArgs e ) : void
e MouseEventArgs /// A that contains the event data. ///
return void
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            base.OnMouseWheel(e);

            if (AllowZoom && SizeMode == ImageBoxSizeMode.Normal)
            {
                int spins;

                // The MouseWheel event can contain multiple "spins" of the wheel so we need to adjust accordingly
                spins = Math.Abs(e.Delta / SystemInformation.MouseWheelScrollDelta);

                // TODO: Really should update the source method to handle multiple increments rather than calling it multiple times
                for (int i = 0; i < spins; i++)
                {
                    ProcessMouseZoom(e.Delta > 0, e.Location);
                }
            }
        }
ImageBox