JavaScript file: Leadtools.Controls.js
Namespace: Leadtools.Controls
Perform the following steps to create an instance of LEADTOOLS ImageViewer in your HTML5/JavaScript application:
Add a reference to the Leadtools.js and Leadtools.Controls.js libraries in the head section of the HTML page.
Add an HTML Div Element that will act as the container for the image viewer in the body section of the HTML page.
Create a new instance of ImageViewer and use it in the JavaScript code.
The following is a complete example:
<!DOCTYPE html><html lang="en"><head><title>ImageViewer Example</title><!-- The LEADTOOLS Javascript Libraries --><script src=Leadtools.js"></script><script src=Leadtools.Controls.js"></script><script type="text/javascript">window.onload = function () {// Get the parent div for the image viewervar div = document.getElementById("imageViewerContainer");// Create a new image viewer instancevar createOptions = new lt.Controls.ImageViewerCreateOptions(div);var imageViewer = new lt.Controls.ImageViewer(createOptions);// Load an image into itimageViewer.imageUrl = "http://localhost/images/image1.png";}</script></head><body><!-- The image viewer container div --><div id="imageViewerContainer" style="width:800px; height:800px"></div></body></html>
|
Products |
Support |
Feedback: Using Image Viewer with HTML5 and JavaScript |
Introduction |
Help Version 19.0.2017.3.22
|
