Page 1 of 1

variable image size

Posted: Fri Aug 11, 2006 9:15 am
by rubenc
I'd like to vary the size of an image on the welcome page of my website. The aim is to make the image the size that it fills the screen nicely. Is this possible using only one image?

Posted: Fri Aug 11, 2006 9:19 am
by Ollie Saunders
The aim is to make the image the size that it fills the screen nicely
Resize it to a size that will fit a resolution of 800 x 600.
I'd like to vary
That isn't strictly necessary in order to achieve your aim.
Is this possible using only one image?
You can do this with the image library (GD2) starting off with a function like createimagefromjpeg().

Posted: Fri Aug 11, 2006 9:57 am
by rubenc
Ok, apparently I have to reformulate what I'm looking for....
At the moment I have the following: a 1024 x 723 pixel image. In my code I resize this to width='650'.
This way it fills my welcome page nicely on a 1024 x 768 monitor. However, this way the image size is fixed, regardless of the visitor's equipment. I'd prefer it if I could also acknowledge the 1600 x 1200 monitor users with a nice website...instead of something small in the corner of their screen they experience now when visiting my website.

For this reason, I'll ask it again: is there an option to use only the original image on my webdomain, but presenting the image on a size that fits the visitor's screen size?

In case words aren't enough, to give you an impression, the website I'm currently developing is at http://www.harmonieleek.nl.

Posted: Fri Aug 11, 2006 10:13 am
by feyd
This cannot be solely done with PHP. Why? Because PHP has no native ability to know what resolution a user has. At minimum, Javascript would be required to read the screen dimensions and send that information to your scripts for adjustment. Other than not doing this idea, an alternative may be Flash or Java.