itemChanged Event

Summary

Occurs when any of the items inside this ImageViewer changes

Syntax

JavaScript Syntax
Object.defineProperty(ImageViewer.prototype,'itemChanged',  
	get: function(), 
	set: function(value) 
) 
function itemChanged.add(function(sender, e)); 
function itemChanged.remove(function(sender, e)); 
TypeScript Syntax
itemChanged: void; 

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 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:

JavaScript Example
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
ParameterTypeDescription
sendervarThe source of the event.
eImageViewerItemChangedEventArgsThe event data.
Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly