Occurs just before an image starts loading as the result of a URL update.
Object.defineProperty(ImageViewer.prototype,'imageLoading',
get: function(),
set: function(value)
)
function imageLoading.add(function(sender, e));
function imageLoading.remove(function(sender, e));
imageLoading: void;
When ImageUrl, BackImageUrl, Url, or BackImageUrl is set, a new ImageLoader is created to handle the loading process. Just before Run is called, the ImageLoading event is fired to give callbacks a chance to modify properties of the image load through ImageLoader. Properties such as UrlMode can be changed, and if the request uses AJAX (per, for example, AjaxDataUrl) then headers can be added or changed via Headers.
This event will also be fired when AutoRemoveItemElements is true and an image must be reloaded because an ImageViewerItem comes back into view.
var div = document.getElementById("imageViewer");
var createOptions = new lt.Controls.ImageViewerCreateOptions(div);
// Set a layout and add and item, or default to SingleViewMode
createOptions.viewLayout = new lt.Controls.ImageViewerVerticalViewLayout();
// This example could also work with ElementsMode
//createOptions.useElements = true;
var viewer = new lt.Controls.ImageViewer(createOptions);
viewer.imageLoading.add(function (sender, e) {
// We now have access to imageLoader and item
// We can change any settings we want
var imageLoader = e.imageLoader;
console.log("Image about to load: " + imageLoader.url);
});
var item = new lt.Controls.ImageViewerItem();
// Image will not load immediately. Must be added to ImageViewer.
item.url = "http://demo.leadtools.com/images/gif/clock.gif";
item.text = "Clock";
setTimeout(function () {
// We set a timeout for 4 seconds, to show that the event
// will execute right before image is loaded
viewer.items.add(item);
}, 4000)
Parameter | Type | Description |
---|---|---|
sender | var | The source of the event. |
e | ImageViewerImageLoadingEventArgs | The event data. |
Products |
Support |
Feedback: imageLoading Event (ImageViewer) - Leadtools.Controls |
Introduction |
Help Version 19.0.2017.3.21
|
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.