Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, May 15, 2017 7:57:09 AM(UTC)
huey.hoague

Groups: Registered
Posts: 18


I added a second div to hold a second image
<table style="width:100%">
<tr>
<td style="width:60%">
<div id="imageViewerDiv" style="width:100%"></div>
</td>
<td>
<div id="imageViewerDiv2" style="width:100%"></div>
</td>
</tr>
</table>

and then in the java I added code to put the image in both image viewers
var imageViewer2 = null;
var imageViewer = null;

window.onload = function () {
// Get the container DIV
var imageViewerDiv = document.getElementById("imageViewerDiv");

// Create the image viewer inside it
var createOptions = new lt.Controls.ImageViewerCreateOptions(imageViewerDiv);
imageViewer = new lt.Controls.ImageViewer(createOptions);
imageViewer.defaultInteractiveMode = new lt.Controls.ImageViewerPanZoomInteractiveMode();
// Add handler to show an alert on errors
imageViewer.itemError.add(function (sender, e) {
alert("Error loading " + e.data.srcElement.src);
});
// Load an image in the viewer
imageViewer.imageUrl = "/Images/Cannon.jpg";



var imageViewerDiv2 = document.getElementById("imageViewerDiv2");

// Create the image viewer inside it
var createOptions2 = new lt.Controls.ImageViewerCreateOptions(imageViewerDiv2);
imageViewer2 = new lt.Controls.ImageViewer(createOptions2);
imageViewer2.defaultInteractiveMode = new lt.Controls.ImageViewerPanZoomInteractiveMode();
// Add handler to show an alert on errors
imageViewer2.itemError.add(function (sender, e) {
alert("Error loading " + e.data.srcElement.src);
});
// Load an image in the viewer
imageViewer2.imageUrl = "/Images/Cannon.jpg";

};

But no matter what I do I still only see the first image. Any idea on what I am missing?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, May 16, 2017 1:19:11 PM(UTC)

Aaron  
Aaron

Groups: Registered, Tech Support, Administrators
Posts: 71

Was thanked: 4 time(s) in 3 post(s)

Hi,

Can you clarify what you mean by "But no matter what I do I still only see the first image."?

I took your code a created a simple sample project out of it. I did notice that you were missing height values on your elements (which was causing the body to be only 6 pixels tall) but after adding those heights, I was able to see the cannon.jpg image in both viewers:

Both Images

I have attached the small sample project that I created from your code as a reference.
File Attachment(s):
TwoImageViewers.zip (316kb) downloaded 177 time(s).
Aaron Brasington
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Tuesday, May 16, 2017 1:35:29 PM(UTC)
huey.hoague

Groups: Registered
Posts: 18


Yup Height was the problem. Thanks.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.177 seconds.