External control that can be used to re-direct the spy glass render.
public Control RedirectControl { get; set; }
public:
property System::Windows::Forms::Control^ RedirectControl
{
System::Windows::Forms::Control^ get()
void set(System::Windows::Forms::Control^ value)
}
The external control that can be used to re-direct the spy glass render. Default value is null.
ImageViewerSpyGlassInteractiveMode supports redirecting the render output to an external control instead of the area under the mouse in the viewer. When this value is set to a valid control on the form, the interactive mode will subscribe to the control System.Windows.Forms.Control.Paint event and will render the magnifying glass content to the surface of this control. Any Windows Forms will work: however, a custom user control or a System.Windows.Forms.PictureBox control is the most efficient since it supports double buffering.
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
Panel panel = new Panel();
panel.Width = 300;
panel.Dock = DockStyle.Right;
_control.Controls.Add(panel);
panel.BringToFront();
Label label = new Label();
label.Text = "Double click to switch between viewer and here";
label.AutoSize = true;
label.Dock = DockStyle.Top;
panel.Controls.Add(label);
// Any control will do, but a PictureBox is perfect since it does double buffering
PictureBox redirectControl = new PictureBox();
redirectControl.Dock = DockStyle.Fill;
redirectControl.BackColor = Color.Gray;
panel.Controls.Add(redirectControl);
redirectControl.BringToFront();
redirectControl.Visible = false;
_imageViewer.BringToFront();
ImageViewerMagnifyGlassInteractiveMode mode = new ImageViewerMagnifyGlassInteractiveMode();
mode.WorkStarted += (sender, e) =>
{
if (mode.RedirectControl != null)
mode.RedirectControl.Visible = true;
};
mode.WorkCompleted += (sender, e) =>
{
if (mode.RedirectControl != null)
mode.RedirectControl.Visible = false;
};
mode.RedirectControl = redirectControl;
panel.MouseDoubleClick += (sender, e) =>
{
if (mode.RedirectControl == null)
mode.RedirectControl = redirectControl;
else
mode.RedirectControl = null;
};
_imageViewer.InteractiveModes.BeginUpdate();
_imageViewer.InteractiveModes.Add(mode);
_imageViewer.InteractiveModes.EndUpdate();
foreach (var shape in Enum.GetValues(typeof(ImageViewerSpyGlassShape)))
_shapeComboBox.Items.Add(shape);
_shapeComboBox.SelectedItem = mode.Shape;
_shapeComboBox.SelectedIndexChanged += (sender, e) => mode.Shape = (ImageViewerSpyGlassShape)_shapeComboBox.SelectedItem;
ImageViewerSpyGlassInteractiveMode Class
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