(Leadtools.Controls)

RasterImageViewer Class

Show in webframe
Example 





Members 
Represents a scrollable control that displays a LEADTOOLS Leadtools.RasterImage with optional interactive UI operations.
Object Model
Syntax
public class RasterImageViewer : ImageViewer 
Public Class RasterImageViewer 
   Inherits ImageViewer
public sealed class RasterImageViewer : 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
Copy Code  
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Controls;

[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

See Also

Reference

RasterImageViewer Members
Leadtools.Controls Namespace

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.