Occurs when any of the items inside this ImageViewer changes
Object.defineProperty(ImageViewer.prototype,'itemChanged',
get: function(),
set: function(value)
)
function itemChanged.add(function(sender, e));
function itemChanged.remove(function(sender, e));
itemChanged: void;
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 | |
Size | |
Resolution | |
Floater | |
FloaterTransform | |
FloaterOpacity | |
Text | |
IsSelected | |
IsHovered | |
IsEnabled | |
IsVisible | |
Transform | |
Zoom | |
ResizeOnTransform | |
ClipImageToContent | |
ImageHorizontalAlignment | |
ImageVerticalAlignment | |
TextHorizontalAlignment | |
TextHorizontalAlignment |
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:
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());
});
Parameter | Type | Description |
---|---|---|
sender | var | The source of the event. |
e | ImageViewerItemChangedEventArgs | The event data. |
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET