public sealed class RasterImageViewer : ImageViewer
function Leadtools.Controls.RasterImageViewer()
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.
In addition to all the features supported by the ImageViewer class, RasterImageViewer adds the following:
Viewing a LEADTOOLS Leadtools.RasterImage object in Windows Runtime applications using the Image property.
In Windows Runtime, an image that is displayed must be an Leadtools.Junk.ImageSource or one of its derived classes, the RasterImageViewer control keeps the ImageViewer.Source property synchronized with RasterImageViewer.Image, any changes that occur to the LEADTOOLS Leadtools.RasterImage is reflected in the Source property. This control will subscribe to the RasterImage.Changed to monitor any changes that may occur to the image (through image processing for example) and reflect these changes to the Source property.
[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)); } }
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