public class ImageViewerSpyGlassInteractiveMode : ImageViewerInteractiveMode
Public Class ImageViewerSpyGlassInteractiveMode Inherits ImageViewerInteractiveMode
public sealed class ImageViewerSpyGlassInteractiveMode : ImageViewerInteractiveMode
@interface LTImageViewerSpyGlassInteractiveMode:LTImageViewerInteractiveMode<NSCoding>
public class ImageViewerSpyGlassInteractiveMode extends ImageViewerInteractiveMode
function Leadtools.Controls.ImageViewerSpyGlassInteractiveMode()
ImageViewerSpyGlassInteractiveMode derives from ImageViewerInteractiveMode and subscribes to the following events of the InteractiveService:
ImageViewerSpyGlassInteractiveMode works as follows:
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.
When InteractiveService.DragDelta is received, the temporary rectangle is moved to the current position.
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.
using Leadtools; using Leadtools.Codecs; using Leadtools.Controls; [TestMethod] 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; }