Click to See Complete Forum and Search --> : how do I get the size of a banner?


slyfox
01-31-2005, 05:36 PM
Hi peoples

I tried this one, but can't figure it out!

A user enters a banner url and clicks submit, this then saves into the db to be displayed on some other page later.

Now I don't know what the sizes for this picture will be, it could be some huge image taking over the entire page (not good), where it is suppose to be no larger than 400x80..

Any ideas on how to get that banner size using asp vb or js?

Any help, clue or tip will do!

Thanks

PeOfEo
01-31-2005, 06:33 PM
Are you just wanting to check the url of a banner already on the net? Or is the user uploading? Is so what upload component are you using? Perhaps this will be helpful: http://www.chestysoft.com/imagefile/filedemo.asp

slyfox
01-31-2005, 06:58 PM
Nice "pink" theory PeOfEo.. thanks for the reply!

Nope, just pointing. No uploading!

When the banner displays it fetches the banner from another site on the net.

Can it be done?? And how??

Thanks

slyfox
01-31-2005, 07:11 PM
Hi

Don't worry, I found the solution!

Here it is, I got it in the Javascript section!

<script type="text/javascript">
<!--
url = 'http://bettiepage.com/images/photos/bikini/bikini1.jpg';

img = new Image ();
img.src = url;
document.write('<dl><dt>Image</dt><dd>', img.src, '</dd><dt>Height</dt><dd>', img.height, '</dd><dt>Width</dt><dd>', img.width, '</dd></dl>');
// -->
</script>