ImageGlass.ImageBox.SetZoom C# (CSharp) Method

SetZoom() private method

Updates the current zoom.
private SetZoom ( int value, ImageBoxZoomActions actions, ImageBoxActionSources source ) : void
value int The new zoom value.
actions ImageBoxZoomActions The zoom actions that caused the value to be updated.
source ImageBoxActionSources The source of the zoom operation.
return void
        private void SetZoom(int value, ImageBoxZoomActions actions, ImageBoxActionSources source)
        {
            int previousZoom;

            previousZoom = Zoom;

            if (value < MinZoom)
            {
                value = MinZoom;
            }
            else if (value > MaxZoom)
            {
                value = MaxZoom;
            }

            if (_zoom != value)
            {
                _zoom = value;

                OnZoomChanged(EventArgs.Empty);

                OnZoomed(new ImageBoxZoomEventArgs(actions, source, previousZoom, Zoom));
            }
        }
ImageBox