Error processing SSI file
(Leadtools.Controls)

Show in webframe

ItemChanged Event




Occurs when any of the items inside this ImageViewer changes
Syntax
Event Data

The event handler receives an argument of type ImageViewerItemChangedEventArgs containing data related to this event. The following ImageViewerItemChangedEventArgs properties provide information specific to this event.

PropertyDescription
Item Item that has changed.
Reason Reason behind the change.
Remarks

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
Image

ImageViewerItemChangedReason.Image (and optionally ImageViewerItemChangedReason.Resolution if the value of Resolution is automatically changed by the viewer.

SvgDocument

ImageViewerItemChangedReason.Image (and optionally ImageViewerItemChangedReason.Resolution if the value of Resolution is automatically changed by the viewer.

Url

ImageViewerItemChangedReason.Image (and optionally ImageViewerItemChangedReason.Resolution if the value of Resolution is automatically changed by the viewer.

ImageSize

ImageViewerItemChangedReason.Image

PageNumber

ImageViewerItemChangedReason.Image (and optionally ImageViewerItemChangedReason.Resolution if the value of Resolution is automatically changed by the viewer.

Size

ImageViewerItemChangedReason.Size

Resolution

ImageViewerItemChangedReason.Resolution

BackImage

ImageViewerItemChangedReason.BackImage

BackImageUrl

ImageViewerItemChangedReason.BackImageUrl

Floater

ImageViewerItemChangedReason.Floater

FloaterTransform

ImageViewerItemChangedReason.FloaterTransform

FloaterOpacity

ImageViewerItemChangedReason.FloaterTransform

Text

ImageViewerItemChangedReason.Text

IsSelected

ImageViewerItemChangedReason.Selected

IsHovered

ImageViewerItemChangedReason.Hovered

IsEnabled

ImageViewerItemChangedReason.Transform

IsVisible

ImageViewerItemChangedReason.Transform

Transform

ImageViewerItemChangedReason.Transform

Zoom

ImageViewerItemChangedReason.Transform

ResizeOnTransform

ImageViewerItemChangedReason.Transform

ClipImageToContent

ImageViewerItemChangedReason.Transform

ImageHorizontalAlignment

ImageViewerItemChangedReason.Transform

ImageVerticalAlignment

ImageViewerItemChangedReason.Transform

TextHorizontalAlignment

ImageViewerItemChangedReason.Transform

TextHorizontalAlignment

ImageViewerItemChangedReason.Transform

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.

ImageViewerItemChangedEventArgs
Example

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:

Copy Code  
Imports Leadtools
Imports Leadtools.Controls
Imports Leadtools.Codecs
Imports Leadtools.Drawing
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Color

AddHandler _imageViewer.ItemChanged,
Sub(sender, e)
   Dim item As ImageViewerItem = e.Item
   Dim sb As New StringBuilder()
   sb.AppendFormat("ItemChanged:{0} Reason:{1} Size:{2} Res:{3}", _imageViewer.Items.IndexOf(item), e.Reason, item.Size, item.Resolution)
   If Not item.Image Is Nothing Then
      sb.AppendFormat(" Image: {0}bpp {1} by {2}", item.Image.BitsPerPixel, item.Image.Width, item.Image.Height)
   Else
      sb.AppendFormat(" Image: null")
   End If
   Console.WriteLine(sb.ToString())
   If Not item.Url Is Nothing Then
      Console.WriteLine("  Url:" & item.Url.ToString())
   End If
End Sub
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;

_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");
   Console.WriteLine(sb.ToString());
   if (item.Url != null)
      Console.WriteLine("  Url:" + item.Url.ToString());
};
Requirements

Target Platforms

See Also

Reference

ImageViewer Class
ImageViewer Members

Error processing SSI file