←Select platform

RasterImageViewer Class

Summary

Represents a scrollable control that displays a LEADTOOLS Leadtools.RasterImage with optional interactive UI operations.

Syntax

C#
VB
Java
WinRT C#
public class RasterImageViewer : Leadtools.Controls.ImageViewer  
Public Class RasterImageViewer  
   Inherits Leadtools.Controls.ImageViewer 
public sealed class RasterImageViewer : Leadtools.Controls.ImageViewer  
public class RasterImageViewer extends ImageViewer 
function Leadtools.Controls.RasterImageViewer() 

Remarks

Usage

To use the RasterImageViewer class in your Windows Runtime application please see Using LEADTOOLS Viewer Controls in Visual Studio for WinRT (Windows Store)

The RasterImageViewer class derives from ImageViewer and adds functionality to display a LEADTOOLS Leadtools.RasterImage object in Windows Runtime applications. To display an ImageSource or one of its derived classes, use the ImageViewer control.

Features

In addition to all the features supported by the ImageViewer class, RasterImageViewer adds the following:

Example

WinRT C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
 
public async Task RasterImageViewerExample() 
{ 
   Uri imageUrl = new Uri("ms-appx:///Assets/PngImage2.png"); 
   // Zoom current image by a 2 
   _viewer.Zoom(ImageViewerSizeMode.None, 2, _viewer.ImageControlCenter); 
 
   // Scroll by 100 and 200 pixels 
   _viewer.ScrollBy(new Point(100, 200)); 
 
   // Tell the _viewer to not change the scale factor and scroll position when a new image is set 
   // The easiest way is to get all options then remove the ones you do not want to change 
   ImageViewerNewImageResetOptions resetOptions = ImageViewerNewImageResetOptions.All; 
   resetOptions &= ~(ImageViewerNewImageResetOptions.ScaleFactor |   ImageViewerNewImageResetOptions.ScrollOffset); 
   _viewer.NewImageResetOptions = resetOptions; 
 
   using (RasterCodecs codecs = new RasterCodecs()) 
   { 
      StorageFile imageFile = await StorageFile.GetFileFromApplicationUriAsync(imageUrl); 
      _viewer.Image = await codecs.LoadAsync(LeadStreamFactory.Create(imageFile)); 
   } 
} 

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)