예제 #1
0
        private void ImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
        {
            if ((e.Source & ImageBoxActionSources.User) == ImageBoxActionSources.User)
            {
                if ((e.Actions & ImageBoxZoomActions.ActualSize) == ImageBoxZoomActions.ActualSize)
                {
                    VirtualZoom       = 0;
                    ResetZoomOnUpdate = true;
                }
                else if ((e.Actions & ImageBoxZoomActions.ZoomIn) == ImageBoxZoomActions.ZoomIn)
                {
                    VirtualZoom++;
                }
                else if ((e.Actions & ImageBoxZoomActions.ZoomOut) == ImageBoxZoomActions.ZoomOut)
                {
                    VirtualZoom--;
                }

                // TODO: Currently the ZoomChanged and Zoomed events are raised after the zoom level has changed, but before any
                // actions such as modifying scrollbars occur. This means methods such as GetSourceImageRegion will return the
                // wrong X and Y values. Until this is fixed, using a timer to trigger the change.
                // However, if you had lots of map changes to make then using a timer would be a good idea regardless; for example
                // if the user rapdily zooms through the available levels, they'll have a smoother experience if you only load
                // the data once they've stopped zooming
                refreshMapTimer.Stop();
                refreshMapTimer.Start();
            }
        }
        private void originalImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
        {
            ImageBox source;
            ImageBox dest;

            this.DefineImageBoxes(sender, out source, out dest);

            dest.Zoom = source.Zoom;
        }
예제 #3
0
        private void originalImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
        {
            ImageBox source;
            ImageBox dest;

            this.DefineImageBoxes(sender, out source, out dest);

            dest.Zoom = source.Zoom;

            zoomToolStripStatusLabel.Text = source.Zoom + "%";
        }
예제 #4
0
 private void previewImg_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
     if (previewImg.Image == null)
     {
         return;
     }
     if (previewImg.Zoom < 25)
     {
         previewImg.Zoom = 25;
     }
     if (previewImg.Zoom != lastZoom)
     {
         if (resetImageOnMove)
         {
             ResetToLastState();
         }
         lastZoom = previewImg.Zoom;
     }
     UpdatePreviewInfo();
 }
예제 #5
0
        /// <summary>
        /// Raises the <see cref="Zoomed" /> event.
        /// </summary>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected virtual void OnZoomed(ImageBoxZoomEventArgs e)
        {
            EventHandler<ImageBoxZoomEventArgs> handler;

            handler = this.Zoomed;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #6
0
 private void imbPreview_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
     tslZoom.Text = "Zoom: " + imbPreview.Zoom + "%";
 }
예제 #7
0
 private void zoomImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
   this.UpdateMiniMap();
 }
 private void imageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
     this.UpdateStatusBar();
 }
    private void imageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
    {
      if ((e.Source & ImageBoxActionSources.User) == ImageBoxActionSources.User)
      {
        if ((e.Actions & ImageBoxZoomActions.ActualSize) == ImageBoxZoomActions.ActualSize)
        {
          this.VirtualZoom = 0;
          this.ResetZoomOnUpdate = true;
        }
        else if ((e.Actions & ImageBoxZoomActions.ZoomIn) == ImageBoxZoomActions.ZoomIn)
          this.VirtualZoom++;
        else if ((e.Actions & ImageBoxZoomActions.ZoomOut) == ImageBoxZoomActions.ZoomOut)
          this.VirtualZoom--;

        // TODO: Currently the ZoomChanged and Zoomed events are raised after the zoom level has changed, but before any
        // actions such as modifying scrollbars occur. This means methods such as GetSourceImageRegion will return the
        // wrong X and Y values. Until this is fixed, using a timer to trigger the change.
        // However, if you had lots of map changes to make then using a timer would be a good idea regardless; for example
        // if the user rapdily zooms through the available levels, they'll have a smoother experiance if you only load
        // the data once they've stopped zooming
        refreshMapTimer.Stop();
        refreshMapTimer.Start();
      }
    }
예제 #10
0
 private void previewImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
     previewImageBox.InterpolationMode = previewImageBox.Zoom < 100 ? InterpolationMode.HighQualityBicubic : InterpolationMode.NearestNeighbor;
 }
예제 #11
0
 private void ImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
     zoom = e.NewZoom;
     tscbZoomLevels.Text = $"{imgbox.Zoom}%";
 }
예제 #12
0
 private void imbPreview_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
     tslZoom.Text = string.Format(ZoomText_, imbPreview.Zoom);
 }
 private void imageBox_Zoomed(object sender, ImageBoxZoomEventArgs e)
 {
   this.UpdateStatusBar();
 }