Zooms the image inside the viewer around the user mouse click or touch tap.
public class ImageViewerZoomAtInteractiveMode : ImageViewerInteractiveMode public ref class ImageViewerZoomAtInteractiveMode : ImageViewerInteractiveMode ImageViewerZoomAtInteractiveMode derives from ImageViewerInteractiveMode and subscribes to the following events of the InteractiveService:
When a valid Tap event occurs and InteractiveEventArgs.IsHandled is false, this interactive mode will start working and set InteractiveEventArgs.IsHandled to true.
This interactive mode uses ImageViewer.Zoom to zoom the image inside the viewer based on the tap event. If the value of ScaleFactor is greater than 1, then the viewer will zoom the image in. If the value of ScaleFactor is less than 1, then the viewer will zoom the image out.
For more information, refer to Image Viewer Interactive Modes.
using Leadtools;using Leadtools.Controls;using Leadtools.Codecs;using Leadtools.Drawing;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;public void ImageViewer_Example(){// Create the form that holds the ImageViewernew MyForm().ShowDialog();}class MyForm : Form{public MyForm(){this.Size = new Size(800, 800);}// LEADTOOLS ImageViewer to be used with this exampleprivate ImageViewer _imageViewer;// Information labelprivate Label _label;protected override void OnLoad(EventArgs e){// Create a panel to the topvar panel = new Panel();panel.Dock = DockStyle.Top;panel.BorderStyle = BorderStyle.FixedSingle;this.Controls.Add(panel);// Add an "Example" button to the panelvar button = new Button();button.Text = "&Example";button.Click += (sender, e1) => Example();panel.Controls.Add(button);// Add a label to the panel_label = new Label();_label.Top = button.Bottom;_label.Width = 800;_label.Text = "Example...";panel.Controls.Add(_label);// Create the image viewer taking the rest of the form_imageViewer = new ImageViewer();_imageViewer.Dock = DockStyle.Fill;_imageViewer.BackColor = Color.Bisque;this.Controls.Add(_imageViewer);_imageViewer.BringToFront();// Add Pan/Zoom interactive mode// Click and drag to pan, CTRL-Click and drag to zoom in and out_imageViewer.DefaultInteractiveMode = new ImageViewerPanZoomInteractiveMode();// Load an imageusing (var codecs = new RasterCodecs())_imageViewer.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp"));base.OnLoad(e);}private void Example(){// Example code goes here}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
