dispose Method


Destroys this ImageViewer and removes it from the page.


JavaScript Syntax
ImageViewer.prototype.dispose = function() 
TypeScript Syntax
dispose(): void; 


ImageViewer will add HTML elements to the page and subscribe to multiple JavaScript events. If your application involves adding and removing ImageViewer objects from the page, then you must call the Dispose method to remove the object from the page and clean up any resources being used.


Run the example. When you click the Example button, the viewer will be removed.

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
function ImageViewer_Dispose() { 
   var createOptions = new lt.Controls.ImageViewerCreateOptions(imageViewerDiv2); 
   var myViewer = new lt.Controls.ImageViewer(createOptions); 
   myViewer.image = this._imageViewer.image; 
   /// ... 
   /// put your code here ... 
   /// ... 


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