|
-
Dec 18th, 2000, 10:44 AM
#1
Hi,
I was wondering if anyone can tell me how to get the width and height of a picture (which could actually be a jpg, or a gif, or whatever) from within code.
Here's what I need it for: I have a box of a certain size in which I need to display a picture. I want to keep the right proportions of the picture, I just want to scale it. What I could do is say that the width has to be a certain amount of pixels, but in that case, if the picture would be not so wide, but very high, it would still go out of my box. Same goes for if I set its height to a certain value, and the picture would not be so high, but very wide.
So the only option (in my opinion, but correct me if I'm wrong) is to determine what is bigger, the picture's height or its width, and then maximise that size.
Anybody have any idea on how to do this? It could be either in VB-Script or Javascript, it doesn't really matter, as long as it works. Any help would be highly appreciated.
Thanx,
Marcel
-
Dec 19th, 2000, 01:55 AM
#2
-
Dec 19th, 2000, 02:45 AM
#3
Does that actually work?
I did find another asp script which does the trick, but it's way longer than this one. I'll try it though.
Thanx anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|