Occurs when any of the items inside this ImageViewer changes.
public event EventHandler<ImageViewerItemChangedEventArgs> ItemChanged
public:
event EventHandler<Leadtools::Controls::ImageViewerItemChangedEventArgs^>^ ItemChanged
This event occurs when any of the items inside this ImageViewer changes. The ImageViewerItemChangedEventArgs will contain the item that has been changed in ImageViewerItemChangedEventArgs.Item and the reason for the change in ImageViewerItemChangedEventArgs.Reason.
Change the value of the following properties or calling the methods programmatically or by the viewer will raise the ItemChanged event with the specified reason:
Property or Method | Value of ImageViewerItemChangedEventArgs.Reason |
---|---|
ImageViewerItemChangedReason.Image (and optionally
ImageViewerItemChangedReason |
|
ImageViewerItemChangedReason.Image (and optionally
ImageViewerItemChangedReason |
|
ImageViewerItemChangedReason.Image (and optionally
ImageViewerItemChangedReason |
|
ImageViewerItemChangedReason.Image (and optionally
ImageViewerItemChangedReason |
|
The viewer automatically listens to these events internally and will perform the necessary action, for example, if any property that affect the transformation changes, UpdateTransform will be called. If the property change requires rendering only, then the item will be invalidated.
This example will track the ItemChanged and ItemError event and show information on them.
Run the demo, click the Example button.
Start with the ImageViewer example, remove all the code inside the example function (search for the "// TODO: add example code here" comment) and insert the following code:
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
public void ImageViewerItemChanged_Example()
{
_imageViewer.ItemChanged += (sender, e) =>
{
var item = e.Item;
var sb = new StringBuilder();
sb.AppendFormat("ItemChanged:{0} Reason:{1} Size:{2} Res:{3}", _imageViewer.Items.IndexOf(item), e.Reason, item.Size, item.Resolution);
if (item.Image != null)
sb.AppendFormat(" Image: {0}bpp {1} by {2}", item.Image.BitsPerPixel, item.Image.Width, item.Image.Height);
else
sb.AppendFormat(" Image: null");
Debug.WriteLine(sb.ToString());
if (item.Url != null)
Debug.WriteLine(" Url:" + item.Url.ToString());
};
}
Parameter | Type | Description |
---|---|---|
sender | object | The source of the event. |
e | ImageViewerItemChangedEventArgs | The event data. |
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document