←Select platform

Image Property (ImageViewerItem)

Summary

Image associated with this item.

Syntax

C#
VB
C++
public RasterImage Image { get; set; }
Public Property Image() As RasterImage 
   Get 
   Set 
public:  
   property RasterImage^ Image 
   { 
      RasterImage^ get() 
      void set(RasterImage^ value) 
   } 

Property Value

The image associated with this item. Default value is null.

Remarks

The item can have either a value in Image or SvgDocument but not both. Setting one value will automatically delete the other.

When setting Image to a new value, the previous image will be automatically disposed if the value of AutoDisposeImages is set to true. Note that setting the same RasterImage object into multiple items in the same viewer is supported, and the viewer will only dispose the image if it is the last reference found in all the items. When setting the same RasterImage into items from separate viewers, the ownership and disposing of the RasterImage objects must be handled by the user.

Changing the value of this property will fire the ItemChanged event with ImageViewerItemChangedReason will automatically be update as well with the DPI of the new image.

The viewer will subscribe to RasterImage.Changed and automatically perform the necessary updates when the image changes externally by other parts of the application.

Image property of ImageViewer will update this member if this is the active item when the viewer is used in single item mode.

For more information, refer to Image Viewer Items.

Example

C#
VB
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
 
ImageViewerItem item = _imageViewer.GetLargestVisibleItem(ImageViewerItemPart.Content); 
if (item != null) 
{ 
   var image = item.Image.Clone(); 
   new InvertCommand().Run(image); 
   item.Image = image; 
} 
Imports Leadtools 
Imports Leadtools.Controls 
Imports Leadtools.Codecs 
Imports Leadtools.Drawing 
Imports Leadtools.ImageProcessing 
Imports Leadtools.ImageProcessing.Color 
 
Dim item As ImageViewerItem = _imageViewer.GetLargestVisibleItem(ImageViewerItemPart.Content) 
If Not item Is Nothing Then 
   Dim image As RasterImage = item.Image.Clone() 
   CType(New InvertCommand(), InvertCommand).Run(image) 
   item.Image = image 
End If 

Requirements

Target Platforms

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
Leadtools.Controls Assembly
Click or drag to resize