←Select platform

ImageViewerSpyGlassInteractiveMode Class

Summary

Draws and pans a spy glass on top of the viewer.

Syntax

C#
VB
Java
Objective-C
WinRT C#
public class ImageViewerSpyGlassInteractiveMode : Leadtools.Controls.ImageViewerInteractiveMode  
Public Class ImageViewerSpyGlassInteractiveMode  
   Inherits Leadtools.Controls.ImageViewerInteractiveMode 
public sealed class ImageViewerSpyGlassInteractiveMode : Leadtools.Controls.ImageViewerInteractiveMode  
@interface LTImageViewerSpyGlassInteractiveMode:LTImageViewerInteractiveMode <NSCoding> 
public class ImageViewerSpyGlassInteractiveMode extends ImageViewerInteractiveMode 
function Leadtools.Controls.ImageViewerSpyGlassInteractiveMode() 

Remarks

ImageViewerSpyGlassInteractiveMode derives from ImageViewerInteractiveMode and subscribes to the following events of the InteractiveService:

ImageViewerSpyGlassInteractiveMode works as follows:

  1. When InteractiveService.DragStarted is received, a temporary ractangle element is created on top of the viewer, this rectangle is used to draw the spy glass.

  2. When InteractiveService.DragDelta is received, the temporary rectangle is moved to the current position.

  3. When InteractiveService.DragCompleted is received, the temporary canvas is removed.

ImageViewerSpyGlassInteractiveMode interactive mode does not perform any action on the viewer (besides drawing, moving and then removing the spy glass). It is up to the user to implement any custom operation required. For example, to implement a magnify glass. ImageViewerMagnifyGlassInteractiveMode derives from ImageViewerSpyGlassInteractiveMode and overrides the OnDrawImage method to draw a magnified version of the area under the spy glass.

Example

WinRT C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
 
public void ImageViewerSpyGlassInteractiveModeExample() 
{ 
   // Set spy glass as the default interactive mode 
   ImageViewerSpyGlassInteractiveMode spyglassMode = new ImageViewerSpyGlassInteractiveMode(); 
   // Customize it 
   spyglassMode.BorderColor = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 0, 0)); 
   spyglassMode.BackgroundColor = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 0, 255)); 
   spyglassMode.BorderThickness = 2; 
   spyglassMode.Shape = ImageViewerSpyGlassShape.RoundRectangle; 
   spyglassMode.Crosshair = ImageViewerSpyGlassCrosshair.Fine; 
   spyglassMode.Size = new Size(100, 100); 
 
   _viewer.DefaultInteractiveMode = spyglassMode; 
} 

Requirements

Target Platforms

Help Version 19.0.2017.10.28
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly (WinRT / WPF / iOS / OS X / Android)