Error processing SSI file
LEADTOOLS JavaScript (Leadtools.Controls)

ItemChanged Event

Show in webframe
Example 
Occurs when any of the items inside this ImageViewer changes
Syntax
add_itemChanged(function(sender, e))
itemChanged.add(function(sender, e))
remove_itemChanged(function(sender, e))
itemChanged.remove(function(sender, e))
    

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 programatically 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 also set.

Canvas

ImageViewerItemChangedReason.Image (and optionally ImageViewerItemChangedReason.Resolution if the value of Resolution is also set.

Url

ImageViewerItemChangedReason.Image (and optionally ImageViewerItemChangedReason.Resolution if the value of Resolution is also set.

ImageSize

ImageViewerItemChangedReason.Image

Size

ImageViewerItemChangedReason.Size

Resolution

ImageViewerItemChangedReason.Resolution

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.

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:

this._imageViewer.itemChanged.add(function (sender, e) {
   var item = e.item;
   var sb = "ItemChanged: " + this._imageViewer.items.indexOf(item).toString() +
      " Reason:" + e.reason.toString() +
      " Size:" + item.size.toString() +
      " Res:" + item.resolution.toString();
   if (item.image != null)
      sb += " Image: " + item.image.width.toString() + " by " + item.image.height.toString();
   else
      sb += " Image: null";
   alert(sb);

   if (item.url != null)
      alert("  Url:" + item.url.toString());
});
Event Data
Parameter Type Description
sender 'var' The source of the event.
e ImageViewerItemChangedEventArgs The event data.
See Also

Reference

ImageViewer Object
ImageViewer Members

Error processing SSI file