473,587 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="CompanyPict ure" 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 OpenLogoPreview Window()
{
window.open('lo goDisplay.htm', 'myWindow','men ubar=no,toolbar =no,directories =no,resizable=n o,scrollbars=no ,location=no,st atus=no');
}
function OpenPicturePrev iewWindow()
{
window.open('Co mpanyPictureDis play.htm','myWi ndow','menubar= no,toolbar=no,d irectories=no,r esizable=no,scr ollbars=no,loca tion=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.LogoDi splay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('Logo').innerH TML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
*************** *************** *************** ************

CompanyPictureD isplay.htm
*************** *************** *************** *************
function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*************** *************** *************** *************** ****

Thanks,

Tom

Feb 12 '07 #1
9 2574
Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.LogoDi splay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('Logo').innerH TML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the image
is loaded and the all subsequent times it is getting the image from some
cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
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="CompanyPict ure" 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 OpenLogoPreview Window()
{

window.open('lo goDisplay.htm', 'myWindow','men ubar=no,toolbar =no,directories =no,resizable=n o,scrollbars=no ,location=no,st atus=no');
}
function OpenPicturePrev iewWindow()
{

window.open('Co mpanyPictureDis play.htm','myWi ndow','menubar= no,toolbar=no,d irectories=no,r esizable=no,scr ollbars=no,loca tion=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.LogoDi splay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('Logo').innerH TML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
*************** *************** *************** ************

CompanyPictureD isplay.htm
*************** *************** *************** *************
function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*************** *************** *************** *************** ****

Thanks,

Tom



Feb 12 '07 #2
you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.

-- bruce (sqlwork.com)

tshad wrote:
Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.LogoDi splay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('Logo').innerH TML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the image
is loaded and the all subsequent times it is getting the image from some
cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>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="CompanyPict ure" 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 OpenLogoPreview Window()
{

window.open('l ogoDisplay.htm' ,'myWindow','me nubar=no,toolba r=no,directorie s=no,resizable= no,scrollbars=n o,location=no,s tatus=no');
}
function OpenPicturePrev iewWindow()
{

window.open('C ompanyPictureDi splay.htm','myW indow','menubar =no,toolbar=no, directories=no, resizable=no,sc rollbars=no,loc ation=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.ht m
************** *************** *************** *************
function entry()
{
//alert("In LogoDisplay");
document.LogoD isplay.src = "..\\..\\upload s\\" +
opener.documen t.getElementByI d('Logo').inner HTML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeT o(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo( y,x);
window.focus() ;
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
************** *************** *************** *************

CompanyPicture Display.htm
************** *************** *************** **************
function entry()
{
document.Pictu reDisplay.src = "..\\..\\upload s\\" +
opener.documen t.getElementByI d('CompanyPictu re').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeT o(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo( y,x);
window.focus() ;
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
************** *************** *************** *************** *****

Thanks,

Tom



Feb 12 '07 #3
"bruce barker" <no****@nospam. comwrote in message
news:eW******** ******@TK2MSFTN GP03.phx.gbl...
you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.
I have been reading on this and found there are problems trying get this to
work. Correctly. Sometime looping causes infinite loops and out of memory
errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where the
window is opened and then resized and the window that called it is redrawn
and it looks clumsy.

Thanks,

Tom
>
-- bruce (sqlwork.com)

tshad wrote:
>Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.LogoD isplay.src = "..\\..\\upload s\\" +
opener.documen t.getElementByI d('Logo').inner HTML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the
image is loaded and the all subsequent times it is getting the image from
some cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2******* *********@TK2MS FTNGP06.phx.gbl ...
>>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="CompanyPict ure" 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 OpenLogoPreview Window()
{

window.open(' logoDisplay.htm ','myWindow','m enubar=no,toolb ar=no,directori es=no,resizable =no,scrollbars= no,location=no, status=no');
}
function OpenPicturePrev iewWindow()
{

window.open(' CompanyPictureD isplay.htm','my Window','menuba r=no,toolbar=no ,directories=no ,resizable=no,s crollbars=no,lo cation=no,statu s=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.h tm
************* *************** *************** **************
function entry()
{
//alert("In LogoDisplay");
document.Logo Display.src = "..\\..\\upload s\\" +
opener.docume nt.getElementBy Id('Logo').inne rHTML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resize To(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo (y,x);
window.focus( );
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
************* *************** *************** **************

CompanyPictur eDisplay.htm
************* *************** *************** ***************
function entry()
{
document.Pict ureDisplay.src = "..\\..\\upload s\\" +
opener.docume nt.getElementBy Id('CompanyPict ure').innerHTML ;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resize To(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo (y,x);
window.focus( );
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
************* *************** *************** *************** ******

Thanks,

Tom


Feb 12 '07 #4
"tshad" <t@home.comwrot e in message
news:eY******** ******@TK2MSFTN GP05.phx.gbl...
"bruce barker" <no****@nospam. comwrote in message
news:eW******** ******@TK2MSFTN GP03.phx.gbl...
>you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.
I tried to set this but got a "ReadyState = Undefined" in my test alert box
in the following:

*************** *************** *************** ***
function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
alert("id ReadyState = " + id.ReadyState);
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*************** *************** *****

PictureDisplay is an img on the page. Do I need to set it up differently to
test the ReadyState?

Thanks

Tom
>
I have been reading on this and found there are problems trying get this
to work. Correctly. Sometime looping causes infinite loops and out of
memory errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where the
window is opened and then resized and the window that called it is redrawn
and it looks clumsy.

Thanks,

Tom
>>
-- bruce (sqlwork.com)

tshad wrote:
>>Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.Logo Display.src = "..\\..\\upload s\\" +
opener.docume nt.getElementBy Id('Logo').inne rHTML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the
image is loaded and the all subsequent times it is getting the image
from some cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2****** **********@TK2M SFTNGP06.phx.gb l...
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="CompanyPict ure" 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 OpenLogoPreview Window()
{

window.open( 'logoDisplay.ht m','myWindow',' menubar=no,tool bar=no,director ies=no,resizabl e=no,scrollbars =no,location=no ,status=no');
}
function OpenPicturePrev iewWindow()
{

window.open( 'CompanyPicture Display.htm','m yWindow','menub ar=no,toolbar=n o,directories=n o,resizable=no, scrollbars=no,l ocation=no,stat us=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.Log oDisplay.src = "..\\..\\upload s\\" +
opener.docum ent.getElementB yId('Logo').inn erHTML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resiz eTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveT o(y,x);
window.focus ();
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
************ *************** *************** ***************

CompanyPictu reDisplay.htm
************ *************** *************** *************** *
function entry()
{
document.Pic tureDisplay.src = "..\\..\\upload s\\" +
opener.docum ent.getElementB yId('CompanyPic ture').innerHTM L;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resiz eTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveT o(y,x);
window.focus ();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
************ *************** *************** *************** *******

Thanks,

Tom


Feb 13 '07 #5

"tshad" <t@home.comwrot e in message
news:uI******** ******@TK2MSFTN GP03.phx.gbl...
"tshad" <t@home.comwrot e in message
news:eY******** ******@TK2MSFTN GP05.phx.gbl...
>"bruce barker" <no****@nospam. comwrote in message
news:eW******* *******@TK2MSFT NGP03.phx.gbl.. .
>>you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.

I tried to set this but got a "ReadyState = Undefined" in my test alert
box in the following:
Found out my problem here - it is readyState not ReadyState.

I am still curious about the other 2 problems.

Thanks,

Tom
>
*************** *************** *************** ***
function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
alert("id ReadyState = " + id.ReadyState);
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*************** *************** *****

PictureDisplay is an img on the page. Do I need to set it up differently
to test the ReadyState?

Thanks

Tom
>>
I have been reading on this and found there are problems trying get this
to work. Correctly. Sometime looping causes infinite loops and out of
memory errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where
the window is opened and then resized and the window that called it is
redrawn and it looks clumsy.

Thanks,

Tom
>>>
-- bruce (sqlwork.com)

tshad wrote:
Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.Log oDisplay.src = "..\\..\\upload s\\" +
opener.docum ent.getElementB yId('Logo').inn erHTML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the
image is loaded and the all subsequent times it is getting the image
from some cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2***** ***********@TK2 MSFTNGP06.phx.g bl...
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="CompanyPict ure" 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 OpenLogoPreview Window()
{
>
window.open ('logoDisplay.h tm','myWindow', 'menubar=no,too lbar=no,directo ries=no,resizab le=no,scrollbar s=no,location=n o,status=no');
}
function OpenPicturePrev iewWindow()
{
>
window.open ('CompanyPictur eDisplay.htm',' myWindow','menu bar=no,toolbar= no,directories= no,resizable=no ,scrollbars=no, location=no,sta tus=no');
}
>
This works most of the time. But the first time you do it, it has the
wrong
dimension s. 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.Lo goDisplay.src = "..\\..\\upload s\\" +
opener.docu ment.getElement ById('Logo').in nerHTML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resi zeTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.move To(y,x);
window.focu s();
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
*********** *************** *************** *************** *
>
CompanyPict ureDisplay.htm
*********** *************** *************** *************** **
function entry()
{
document.Pi ctureDisplay.sr c = "..\\..\\upload s\\" +
opener.docu ment.getElement ById('CompanyPi cture').innerHT ML;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resi zeTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.move To(y,x);
window.focu s();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*********** *************** *************** *************** ********
>
Thanks,
>
Tom
>
>
>
>
>


Feb 13 '07 #6
you need to use a window.setTimeo ut() to do the loop. a better approach
is to render the image size with the name, so that when client script
opens the img, it can pre-specify the size which has better usability.

-- bruce (sqlwork.com)
tshad wrote:
"bruce barker" <no****@nospam. comwrote in message
news:eW******** ******@TK2MSFTN GP03.phx.gbl...
>you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.

I have been reading on this and found there are problems trying get this to
work. Correctly. Sometime looping causes infinite loops and out of memory
errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where the
window is opened and then resized and the window that called it is redrawn
and it looks clumsy.

Thanks,

Tom
>-- bruce (sqlwork.com)

tshad wrote:
>>Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.Logo Display.src = "..\\..\\upload s\\" +
opener.docume nt.getElementBy Id('Logo').inne rHTML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the
image is loaded and the all subsequent times it is getting the image from
some cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2****** **********@TK2M SFTNGP06.phx.gb l...
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="CompanyPict ure" 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 OpenLogoPreview Window()
{

window.open( 'logoDisplay.ht m','myWindow',' menubar=no,tool bar=no,director ies=no,resizabl e=no,scrollbars =no,location=no ,status=no');
}
function OpenPicturePrev iewWindow()
{

window.open( 'CompanyPicture Display.htm','m yWindow','menub ar=no,toolbar=n o,directories=n o,resizable=no, scrollbars=no,l ocation=no,stat us=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.Log oDisplay.src = "..\\..\\upload s\\" +
opener.docum ent.getElementB yId('Logo').inn erHTML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resiz eTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveT o(y,x);
window.focus ();
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
************ *************** *************** ***************

CompanyPictu reDisplay.htm
************ *************** *************** *************** *
function entry()
{
document.Pic tureDisplay.src = "..\\..\\upload s\\" +
opener.docum ent.getElementB yId('CompanyPic ture').innerHTM L;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resiz eTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveT o(y,x);
window.focus ();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
************ *************** *************** *************** *******

Thanks,

Tom


Feb 13 '07 #7
"bruce barker" <no****@nospam. comwrote in message
news:ej******** ******@TK2MSFTN GP02.phx.gbl...
you need to use a window.setTimeo ut() to do the loop. a better approach is
to render the image size with the name, so that when client script opens
the img, it can pre-specify the size which has better usability.
Not sure what you mean on the pre-specifying the size.

But I couldn't really get the setTimeout to work or using a pause type of
scenario and I assume this is why others couldn't either. What happens is
when you are in a loop (while loop or for loop of x iterations to simulate
milliseconds) it seems to be gobbling up the cpu (as it is running as fast
as it can) and no work gets done until the loop is finished.

For example, I tried:

*************** *************** **
function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");

for (var x = 1; x <= 10; x++)
{
if (id.readyState == "complete") break;
pauseIt(10000);
}

alert("id after for loop ReadyState = " + id.readyState + " x = " + x);
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
alert("id ReadyState = " + id.readyState);
}
function pauseIt(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
}
*************** *************** *************** **

This would come back as uninitialized after the for loop and would still
seem to work fine. The last alert would show it as complete.

I need to find a way to make it wait about 10 seconds for each loop (without
some time of other loop) while the image is being loaded. In this case, it
will usually only use one loop to load the image. It is normally loaded in
about 1 or 2 seconds (if even that long - if cached).

Thanks,

Tom
>
-- bruce (sqlwork.com)
tshad wrote:
>"bruce barker" <no****@nospam. comwrote in message
news:eW******* *******@TK2MSFT NGP03.phx.gbl.. .
>>you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.

I have been reading on this and found there are problems trying get this
to work. Correctly. Sometime looping causes infinite loops and out of
memory errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where
the window is opened and then resized and the window that called it is
redrawn and it looks clumsy.

Thanks,

Tom
>>-- bruce (sqlwork.com)

tshad wrote:
Could this be that the image is not totally loaded yet?

The first thing it does is load the image into the image tag:

document.Log oDisplay.src = "..\\..\\upload s\\" +
opener.docum ent.getElementB yId('Logo').inn erHTML;

Then it gets the size of the image:

id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;

is it possible by the time I get to this set of code only part of the
image is loaded and the all subsequent times it is getting the image
from some cache that is quicker?

I can't think of any other reason that would cause this?

Thanks,

Tom

"tshad" <t@home.comwrot e in message
news:%2***** ***********@TK2 MSFTNGP06.phx.g bl...
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="CompanyPict ure" 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 OpenLogoPreview Window()
{
>
window.open ('logoDisplay.h tm','myWindow', 'menubar=no,too lbar=no,directo ries=no,resizab le=no,scrollbar s=no,location=n o,status=no');
}
function OpenPicturePrev iewWindow()
{
>
window.open ('CompanyPictur eDisplay.htm',' myWindow','menu bar=no,toolbar= no,directories= no,resizable=no ,scrollbars=no, location=no,sta tus=no');
}
>
This works most of the time. But the first time you do it, it has the
wrong
dimension s. 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.Lo goDisplay.src = "..\\..\\upload s\\" +
opener.docu ment.getElement ById('Logo').in nerHTML;
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resi zeTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.move To(y,x);
window.focu s();
}
</script>
</head>
<body onLoad="entry() ">
<img name="LogoDispl ay">
</body>
</html>
*********** *************** *************** *************** *
>
CompanyPict ureDisplay.htm
*********** *************** *************** *************** **
function entry()
{
document.Pi ctureDisplay.sr c = "..\\..\\upload s\\" +
opener.docu ment.getElement ById('CompanyPi cture').innerHT ML;
id = document.getEle mentById("Pictu reDisplay");
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resi zeTo(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.move To(y,x);
window.focu s();
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*********** *************** *************** *************** ********
>
Thanks,
>
Tom
>
>
>
>
>

Feb 13 '07 #8
I finally got the setTimeout to work and it seems to work pretty well.

I am curious as to why the large image loads quick after the first time it
loads on any machine. I assume it is cached on the local machine and have
been trying to get rid of it for testing by going to tools/"internet
options" and press the Delete Temporary Internet files including offline
content. But this doesn't seem to work.

Anyone know how to get rid of the Cache that my local machine is using (if
in fact that is what happened).

Here is what I did to fix my image load problem using setTimeout - might
help someone else.
*************** *************** *************** *************** ***
<script language="JavaS cript">
//window.resizeTo (400, 400);
var id;
var ktr = 0;

function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
setTimeout("res izeIt()",50);
}
function resizeIt ()
{
ktr=ktr+1;
if (ktr 3000)
{
// alert("ktr in resizeIt = " + ktr);
return;
}
if (id.readyState != "complete")
{
// alert("ktr in resizeIt = " + ktr + " readyState = " + id.readyState);
setTimeout("res izeIt()",50);
}
else
{
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
// alert("id ReadyState = " + id.readyState + " ktr = " + ktr);
}
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*************** *************** ******

Thanks,

Tom
"tshad" <t@home.comwrot e in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
"bruce barker" <no****@nospam. comwrote in message
news:ej******** ******@TK2MSFTN GP02.phx.gbl...
>you need to use a window.setTimeo ut() to do the loop. a better approach
is to render the image size with the name, so that when client script
opens the img, it can pre-specify the size which has better usability.

Not sure what you mean on the pre-specifying the size.

But I couldn't really get the setTimeout to work or using a pause type of
scenario and I assume this is why others couldn't either. What happens is
when you are in a loop (while loop or for loop of x iterations to simulate
milliseconds) it seems to be gobbling up the cpu (as it is running as fast
as it can) and no work gets done until the loop is finished.

For example, I tried:

*************** *************** **
function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");

for (var x = 1; x <= 10; x++)
{
if (id.readyState == "complete") break;
pauseIt(10000);
}

alert("id after for loop ReadyState = " + id.readyState + " x = " + x);
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
alert("id ReadyState = " + id.readyState);
}
function pauseIt(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
}
*************** *************** *************** **

This would come back as uninitialized after the for loop and would still
seem to work fine. The last alert would show it as complete.

I need to find a way to make it wait about 10 seconds for each loop
(without some time of other loop) while the image is being loaded. In
this case, it will usually only use one loop to load the image. It is
normally loaded in about 1 or 2 seconds (if even that long - if cached).

Thanks,

Tom
>>
-- bruce (sqlwork.com)
tshad wrote:
>>"bruce barker" <no****@nospam. comwrote in message
news:eW****** ********@TK2MSF TNGP03.phx.gbl. ..
you are correct. setting the src starts a download, you should check
readyState of the image before checking the size.

I have been reading on this and found there are problems trying get this
to work. Correctly. Sometime looping causes infinite loops and out of
memory errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where
the window is opened and then resized and the window that called it is
redrawn and it looks clumsy.

Thanks,

Tom
-- bruce (sqlwork.com)

tshad wrote:
Could this be that the image is not totally loaded yet?
>
The first thing it does is load the image into the image tag:
>
document.Lo goDisplay.src = "..\\..\\upload s\\" +
opener.docu ment.getElement ById('Logo').in nerHTML;
>
Then it gets the size of the image:
>
id = document.getEle mentById("LogoD isplay");
w = id.width+10;
h = id.height+50;
>
is it possible by the time I get to this set of code only part of the
image is loaded and the all subsequent times it is getting the image
from some cache that is quicker?
>
I can't think of any other reason that would cause this?
>
Thanks,
>
Tom
>
"tshad" <t@home.comwrot e in message
news:%2**** ************@TK 2MSFTNGP06.phx. gbl...
>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="CompanyPict ure" runat="server"/>
>>
>I have 2 links that open the windows to preview these images. The
>previewe d
>images are done on separate html pages that do nothing but display
>the
>image.
>>
>function OpenLogoPreview Window()
>{
>>
>window.ope n('logoDisplay. htm','myWindow' ,'menubar=no,to olbar=no,direct ories=no,resiza ble=no,scrollba rs=no,location= no,status=no');
>}
>function OpenPicturePrev iewWindow()
>{
>>
>window.ope n('CompanyPictu reDisplay.htm', 'myWindow','men ubar=no,toolbar =no,directories =no,resizable=n o,scrollbars=no ,location=no,st atus=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
>incorrec t.
>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
>correctl y 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:
>>
>LogoDispla y.htm
>********** *************** *************** *************** **
>function entry()
>{
>//alert("In LogoDisplay");
>document.L ogoDisplay.src = "..\\..\\upload s\\" +
>opener.doc ument.getElemen tById('Logo').i nnerHTML;
>id = document.getEle mentById("LogoD isplay");
>w = id.width+10;
>h = id.height+50;
>// alert ("w = " + w + " h = " + h);
>window.res izeTo(w,h);
> if (screen) {
> x = (screen.availHe ight - h)/2;
> y = (screen.availWi dth - w)/2;
> }
>window.mov eTo(y,x);
>window.foc us();
>}
></script>
></head>
><body onLoad="entry() ">
><img name="LogoDispl ay">
></body>
></html>
>********** *************** *************** *************** **
>>
>CompanyPic tureDisplay.htm
>********** *************** *************** *************** ***
>function entry()
>{
>document.P ictureDisplay.s rc = "..\\..\\upload s\\" +
>opener.doc ument.getElemen tById('CompanyP icture').innerH TML;
>id = document.getEle mentById("Pictu reDisplay");
>w = id.width+10;
>h = id.height+50;
>// alert ("w = " + w + " h = " + h);
>window.res izeTo(w,h);
> if (screen) {
> x = (screen.availHe ight - h)/2;
> y = (screen.availWi dth - w)/2;
> }
>window.mov eTo(y,x);
>window.foc us();
>}
></script>
></head>
><body onLoad="entry() ">
><img name="PictureDi splay">
></body>
></html>
>********** *************** *************** *************** *********
>>
>Thanks,
>>
>Tom
>>
>>
>>
>>
>>


Feb 13 '07 #9
Well, I thought this was working - which it was until I looked at IE7.

Now, IE7 puts an address bar at the top of the picture below the title bar.
This isn't the normal address bar that you type in but one that just shows
theURL. Is this another security restriction???

This is getting very irritating. I finally get it working and a new browser
messes it up.

Is there someway to get rid of this bar? All of my windows are wrong now.

Thanks,

Tom
"tshad" <t@home.comwrot e in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>I finally got the setTimeout to work and it seems to work pretty well.

I am curious as to why the large image loads quick after the first time it
loads on any machine. I assume it is cached on the local machine and have
been trying to get rid of it for testing by going to tools/"internet
options" and press the Delete Temporary Internet files including offline
content. But this doesn't seem to work.

Anyone know how to get rid of the Cache that my local machine is using (if
in fact that is what happened).

Here is what I did to fix my image load problem using setTimeout - might
help someone else.
*************** *************** *************** *************** ***
<script language="JavaS cript">
//window.resizeTo (400, 400);
var id;
var ktr = 0;

function entry()
{
document.Pictur eDisplay.src = "..\\..\\upload s\\" +
opener.document .getElementById ('CompanyPictur e').innerHTML;
id = document.getEle mentById("Pictu reDisplay");
setTimeout("res izeIt()",50);
}
function resizeIt ()
{
ktr=ktr+1;
if (ktr 3000)
{
// alert("ktr in resizeIt = " + ktr);
return;
}
if (id.readyState != "complete")
{
// alert("ktr in resizeIt = " + ktr + " readyState = " + id.readyState);
setTimeout("res izeIt()",50);
}
else
{
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeTo (w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo(y ,x);
window.focus();
// alert("id ReadyState = " + id.readyState + " ktr = " + ktr);
}
}
</script>
</head>
<body onLoad="entry() ">
<img name="PictureDi splay">
</body>
</html>
*************** *************** ******

Thanks,

Tom
"tshad" <t@home.comwrot e in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>"bruce barker" <no****@nospam. comwrote in message
news:ej******* *******@TK2MSFT NGP02.phx.gbl.. .
>>you need to use a window.setTimeo ut() to do the loop. a better approach
is to render the image size with the name, so that when client script
opens the img, it can pre-specify the size which has better usability.

Not sure what you mean on the pre-specifying the size.

But I couldn't really get the setTimeout to work or using a pause type of
scenario and I assume this is why others couldn't either. What happens
is when you are in a loop (while loop or for loop of x iterations to
simulate milliseconds) it seems to be gobbling up the cpu (as it is
running as fast as it can) and no work gets done until the loop is
finished.

For example, I tried:

************** *************** ***
function entry()
{
document.Pictu reDisplay.src = "..\\..\\upload s\\" +
opener.documen t.getElementByI d('CompanyPictu re').innerHTML;
id = document.getEle mentById("Pictu reDisplay");

for (var x = 1; x <= 10; x++)
{
if (id.readyState == "complete") break;
pauseIt(10000);
}

alert("id after for loop ReadyState = " + id.readyState + " x = " + x);
w = id.width+10;
h = id.height+50;
// alert ("w = " + w + " h = " + h);
window.resizeT o(w,h);
if (screen) {
x = (screen.availHe ight - h)/2;
y = (screen.availWi dth - w)/2;
}
window.moveTo( y,x);
window.focus() ;
alert("id ReadyState = " + id.readyState);
}
function pauseIt(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDat e-date < millis);
}
************** *************** *************** ***

This would come back as uninitialized after the for loop and would still
seem to work fine. The last alert would show it as complete.

I need to find a way to make it wait about 10 seconds for each loop
(without some time of other loop) while the image is being loaded. In
this case, it will usually only use one loop to load the image. It is
normally loaded in about 1 or 2 seconds (if even that long - if cached).

Thanks,

Tom
>>>
-- bruce (sqlwork.com)
tshad wrote:
"bruce barker" <no****@nospam. comwrote in message
news:eW***** *********@TK2MS FTNGP03.phx.gbl ...
you are correct. setting the src starts a download, you should check
readyStat e of the image before checking the size.

I have been reading on this and found there are problems trying get
this to work. Correctly. Sometime looping causes infinite loops and
out of memory errors.

Is there a way around this?

Also, is there some type of hide window function? I am trying open the
window in a hidden state until the image is loaded and resized before I
display it. Right now I get this sort of post back type of look where
the window is opened and then resized and the window that called it is
redrawn and it looks clumsy.

Thanks,

Tom
-- bruce (sqlwork.com)
>
tshad wrote:
>Could this be that the image is not totally loaded yet?
>>
>The first thing it does is load the image into the image tag:
>>
>document.L ogoDisplay.src = "..\\..\\upload s\\" +
>opener.doc ument.getElemen tById('Logo').i nnerHTML;
>>
>Then it gets the size of the image:
>>
> id = document.getEle mentById("LogoD isplay");
> w = id.width+10;
> h = id.height+50;
>>
>is it possible by the time I get to this set of code only part of the
>image is loaded and the all subsequent times it is getting the image
>from some cache that is quicker?
>>
>I can't think of any other reason that would cause this?
>>
>Thanks,
>>
>Tom
>>
>"tshad" <t@home.comwrot e in message
>news:%2*** *************@T K2MSFTNGP06.phx .gbl...
>>This was posted before but the message got messed up (all NLs were
>>strippe d
>>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="CompanyPict ure" runat="server"/>
>>>
>>I have 2 links that open the windows to preview these images. The
>>preview ed
>>images are done on separate html pages that do nothing but display
>>the
>>image.
>>>
>>functio n OpenLogoPreview Window()
>>{
>>>
>>window.op en('logoDisplay .htm','myWindow ','menubar=no,t oolbar=no,direc tories=no,resiz able=no,scrollb ars=no,location =no,status=no') ;
>>}
>>functio n OpenPicturePrev iewWindow()
>>{
>>>
>>window.op en('CompanyPict ureDisplay.htm' ,'myWindow','me nubar=no,toolba r=no,directorie s=no,resizable= no,scrollbars=n o,location=no,s tatus=no');
>>}
>>>
>>This works most of the time. But the first time you do it, it has
>>the wrong
>>dimension s. 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
>>correct ly 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:
>>>
>>LogoDispl ay.htm
>>********* *************** *************** *************** ***
>>functio n entry()
>>{
>>//alert("In LogoDisplay");
>>document. LogoDisplay.src = "..\\..\\upload s\\" +
>>opener.do cument.getEleme ntById('Logo'). innerHTML;
>>id = document.getEle mentById("LogoD isplay");
>>w = id.width+10;
>>h = id.height+50;
>>// alert ("w = " + w + " h = " + h);
>>window.re sizeTo(w,h);
>> if (screen) {
>> x = (screen.availHe ight - h)/2;
>> y = (screen.availWi dth - w)/2;
>> }
>>window.mo veTo(y,x);
>>window.fo cus();
>>}
>></script>
>></head>
>><body onLoad="entry() ">
>><img name="LogoDispl ay">
>></body>
>></html>
>>********* *************** *************** *************** ***
>>>
>>CompanyPi ctureDisplay.ht m
>>********* *************** *************** *************** ****
>>functio n entry()
>>{
>>document. PictureDisplay. src = "..\\..\\upload s\\" +
>>opener.do cument.getEleme ntById('Company Picture').inner HTML;
>>id = document.getEle mentById("Pictu reDisplay");
>>w = id.width+10;
>>h = id.height+50;
>>// alert ("w = " + w + " h = " + h);
>>window.re sizeTo(w,h);
>> if (screen) {
>> x = (screen.availHe ight - h)/2;
>> y = (screen.availWi dth - w)/2;
>> }
>>window.mo veTo(y,x);
>>window.fo cus();
>>}
>></script>
>></head>
>><body onLoad="entry() ">
>><img name="PictureDi splay">
>></body>
>></html>
>>********* *************** *************** *************** **********
>>>
>>Thanks,
>>>
>>Tom
>>>
>>>
>>>
>>>
>>>



Feb 13 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4450
by: David | last post by:
Hello I'm writting an apllication and i like to display and offscreen image. However my code doesn't seem to work. It compiles and runs properly but What i want is to associate the button of the menu to switch an image (actually to add rectangels offscreen and bring it to the front). The following codes runs properly. You just need to create...
4
3951
by: Laszlo Zsolt Nagy | last post by:
Hi all, I have a little problem with PIL. I need to display images in a browser (thumbnails) (this is the selector window). I also need the original version of the image to be displayed in a Java applet. One example: thumbnail: http://designasign.biz/applet/GIF_Small/AIRCRAFT/a10per.png
2
1731
by: Dennis | last post by:
This may be easy for most but I can't get this thing to work. I believe I followed all the instructions but when I click on the link no window opens just the default IE page cannot display. Here is exactly what I entered in the link dialog: <a href="javascript:popImage('http://www.sambuccibros.com/carseat.jpg','New Car Seat')"> Is this...
14
11057
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin =...
3
2240
by: c676228 | last post by:
Hi everyone, I have a piece of code in sales.aspx.vb like this: Protected WithEvents Message As System.Web.UI.WebControls.Label Try ... ChartImage.ImageUrl = "ChartGenerator.aspx?" + DataStr + "&ChartType=" + drpChartType.SelectedItem.Value.ToLower() + "&Print=" + printVersion.ToString() ... Catch e As Exception
5
3705
by: wshaer | last post by:
Hi This is the task: and these are my classes: public class Engine{ // Declare the varibles
1
3788
by: rsteph | last post by:
I bought a book to help me learn to use DirectX with windows programming. It's first trying to walk me through some basic windows programming and graphics before getting into DirectX. I'm trying to expand on one of the example programs in the book but I'm having some problems. I can get a frame to appear, then an image gets randomly placed in...
1
3385
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it...
2
3141
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.