Problem with Image display on separate window



This was posted before but the message got messed up (all NLs were stripped
out for some reason).

I have 2 labels that hold the name of different images on my .aspx page.

<asp:Label ID="Logo" runat="server"/>
<asp:Label ID="CompanyPicture" runat="server"/>

I have 2 links that open the windows to preview these images. The previewed
images are done on separate html pages that do nothing but display the
image.

function OpenLogoPreviewWindow()
{
window.open('logoDisplay.htm','myWindow','menubar=no,toolbar=no,directories=no,resizable=no,scrollbars=no,location=no,status=no');
}
function OpenPicturePreviewWindow()
{
window.open('CompanyPictureDisplay.htm','myWindow','menubar=no,toolbar=no,directories=no,resizable=no,scrollbars=no,location=no,status=no');
}

This works most of the time. But the first time you do it, it has the wrong
dimensions. For example, for the CompanyPicture - the size is 502 by
400.The very first time a machine loads this picture, it will be incorrect.
It will be something like 38 by 87. From that point on it will be correct.
Even if I change the picture - it will size it correctly. It will also work
correctly if I reboot the machine.

To test it I need to go to another machine that has
never run it. The code for each page is:

LogoDisplay.htm
*********************************************************
function entry()
{
//alert("In LogoDisplay");
document.LogoDisplay.src = "..\\..\\uploads\\" +
opener.document.getElementById('Logo').innerHTML;
id = document.getElementById("LogoDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo(w,h);
if (screen) {
x = (screen.availHeight - h)/2;
y = (screen.availWidth - w)/2;
}
window.moveTo(y,x);
window.focus();
}
</script>
</head>
<body onLoad="entry()">
<img name="LogoDisplay">
</body>
</html>
*********************************************************

CompanyPictureDisplay.htm
**********************************************************
function entry()
{
document.PictureDisplay.src = "..\\..\\uploads\\" +
opener.document.getElementById('CompanyPicture').innerHTML;
id = document.getElementById("PictureDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo(w,h);
if (screen) {
x = (screen.availHeight - h)/2;
y = (screen.availWidth - w)/2;
}
window.moveTo(y,x);
window.focus();
}
</script>
</head>
<body onLoad="entry()">
<img name="PictureDisplay">
</body>
</html>
****************************************************************

Thanks,

Tom





.



Relevant Pages

  • www Win a place on the Times picture desk cd 15apr06
    ... The 2005 winner of the fourth Times/Tabasco Young Photographer of the Year ... Her portfolio included a wittily timed picture of a table tennis champion ... You can enter either digital images or original prints. ... Your entry must ...
    (uk.rec.competitions)
  • Re: 1911 Census - good news
    ... For the first time also, the images are in colour. ... As with previous censuses the 1911 census shows the name, age, sex, ... How many children have been born to that marriage? ...
    (soc.genealogy.britain)
  • Re: Is this whats been gobbling up all my psters bandwidth?
    ... first time I bought another gig and a few days later it was ... Thing is, Sweetie, them's not my images. ... handful of times have pages been found on keywords. ... Have you compared Analytics with for example Awstats? ...
    (alt.internet.search-engines)
  • Linking images
    ... I have a database of about 250 entries. ... How do I link to the images? ... For example, we have entry 50-00104. ... One picture exists for each entry. ...
    (microsoft.public.access.formscoding)
  • Linking images
    ... I have a database of about 250 entries. ... How do I link to the images? ... For example, we have entry 50-00104. ... One picture exists for each entry. ...
    (microsoft.public.access.formscoding)

Loading