LEADTOOLS WinRT(Leadtools.Controls)
LEAD Technologies, Inc

RasterImageViewer Class

Example 

Members 
Represents a scrollable control that displays a LEADTOOLS Leadtools.RasterImage with optional interactive UI operations. WinRT support
Object Model
RasterImageViewer ClassImageViewerInteractiveMode ClassInteractiveService ClassImageViewerInteractiveMode ClassImageViewerInteractiveMode ClassImageViewerInteractiveMode Class
Syntax
public sealed class RasterImageViewer : 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 a Leadtools.Junk.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
Copy CodeCopy Code  
[TestMethod]
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: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RasterImageViewer Members
Leadtools.Controls Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.