External control that can be used to re-direct the spy glass render.
public Control RedirectControl { get; set; } Public Property RedirectControl() As System.Windows.Forms.ControlGetSet
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 LeadtoolsExamples.Common;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 bufferingPictureBox 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;elsemode.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;
Imports LeadtoolsImports Leadtools.ControlsImports Leadtools.CodecsImports Leadtools.DrawingImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorDim panel As Panel = New Panel()panel.Width = 300panel.Dock = DockStyle.Right_control.Controls.Add(panel)panel.BringToFront()Dim label As Label = New Label()label.Text = "Double click to switch between viewer and here"label.AutoSize = Truelabel.Dock = DockStyle.Toppanel.Controls.Add(label)' Any control will do, but a PictureBox is perfect since it does double bufferingDim redirectControl As PictureBox = New PictureBox()redirectControl.Dock = DockStyle.FillredirectControl.BackColor = Color.Graypanel.Controls.Add(redirectControl)redirectControl.BringToFront()redirectControl.Visible = False_imageViewer.BringToFront()Dim mode As ImageViewerMagnifyGlassInteractiveMode = New ImageViewerMagnifyGlassInteractiveMode()AddHandler mode.WorkStarted,Sub(sender, e)If Not mode.RedirectControl Is Nothing Thenmode.RedirectControl.Visible = TrueEnd IfEnd SubAddHandler mode.WorkCompleted,Sub(sender, e)If Not mode.RedirectControl Is Nothing Thenmode.RedirectControl.Visible = FalseEnd IfEnd Submode.RedirectControl = redirectControlAddHandler panel.MouseDoubleClick,Sub(sender, e)If mode.RedirectControl Is Nothing Thenmode.RedirectControl = redirectControlElsemode.RedirectControl = NothingEnd IfEnd Sub_imageViewer.InteractiveModes.BeginUpdate()_imageViewer.InteractiveModes.Add(mode)_imageViewer.InteractiveModes.EndUpdate()For Each shape As ImageViewerSpyGlassShape In System.Enum.GetValues(GetType(ImageViewerSpyGlassShape))_shapeComboBox.Items.Add(shape)Next shape_shapeComboBox.SelectedItem = mode.ShapeAddHandler _shapeComboBox.SelectedIndexChanged, Sub(sender, e) mode.Shape = CType(_shapeComboBox.SelectedItem, ImageViewerSpyGlassShape)
ImageViewerSpyGlassInteractiveMode Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
