variable image size

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rubenc
Forum Newbie
Posts: 6
Joined: Fri Aug 04, 2006 3:37 am

variable image size

Post 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?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post 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().
rubenc
Forum Newbie
Posts: 6
Joined: Fri Aug 04, 2006 3:37 am

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply