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; }
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 + "%"; }
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(); }
/// <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); } }
private void imbPreview_Zoomed(object sender, ImageBoxZoomEventArgs e) { tslZoom.Text = "Zoom: " + imbPreview.Zoom + "%"; }
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(); } }
private void previewImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e) { previewImageBox.InterpolationMode = previewImageBox.Zoom < 100 ? InterpolationMode.HighQualityBicubic : InterpolationMode.NearestNeighbor; }
private void ImageBox_Zoomed(object sender, ImageBoxZoomEventArgs e) { zoom = e.NewZoom; tscbZoomLevels.Text = $"{imgbox.Zoom}%"; }
private void imbPreview_Zoomed(object sender, ImageBoxZoomEventArgs e) { tslZoom.Text = string.Format(ZoomText_, imbPreview.Zoom); }