xenon2050 Posted July 10, 2007 Share Posted July 10, 2007 Is it possible to scale a image dynamically? I have a image that i want to be the "background" and to have text and buttons in the form of images on top of that, but in specific places. Is it possible to have the image scale to whatever size the browser is? Say down to 1024x768? Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/ Share on other sites More sharing options...
dustinnoe Posted July 10, 2007 Share Posted July 10, 2007 Use javascript window object. That's the only way you are going to gather the information required to do that. Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294019 Share on other sites More sharing options...
cooldude832 Posted July 10, 2007 Share Posted July 10, 2007 not technically, the GD library can load the given image and resize/resample it properly that or you could use a simple function that gives the parameters for a <img> Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294024 Share on other sites More sharing options...
dustinnoe Posted July 10, 2007 Share Posted July 10, 2007 Is it possible to have the image scale to whatever size the browser is? Say down to 1024x768? GD library can't tell you what size the browser is. Use javascript to handle behavior. Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294026 Share on other sites More sharing options...
cooldude832 Posted July 10, 2007 Share Posted July 10, 2007 no it doesn't you are right, but what you do is on first load you set up a session that has the captured info from javascript and then you allow GD to resize all images and you have your info till the session dies using the GD will not bloat/skew your images because you can resample them properly Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294027 Share on other sites More sharing options...
xenon2050 Posted July 10, 2007 Author Share Posted July 10, 2007 Okay.. Thanks for the quick replies. Would doing something like that be smart? I want the site to look good, but not be too incompatible or difficult to view. Also would that be really server intensive? I don't think that is too much of a problem now but something I want to consider. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294031 Share on other sites More sharing options...
cooldude832 Posted July 10, 2007 Share Posted July 10, 2007 not really it would be a single session storing their resolution then you would have a switch for each resolution and then looking into http://us.php.net/manual/en/function.imagecopyresampled.php for the resziing part Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294035 Share on other sites More sharing options...
xenon2050 Posted July 10, 2007 Author Share Posted July 10, 2007 Okay thank you for the great ideas... I'm off to research now.... If you know of any sites offhand that have tutorials for what you have said I would greatly appreciate it if you could link them. I don't want to waste your time though so only if you know of any offhand. Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294038 Share on other sites More sharing options...
dustinnoe Posted July 10, 2007 Share Posted July 10, 2007 It's also a great opportunity to use AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294041 Share on other sites More sharing options...
cooldude832 Posted July 10, 2007 Share Posted July 10, 2007 yes, but best idea is to combine php with javascript and if its a first load set some stuff ajax it off then refresh the given page so it initializes the script its a challenge with sessions because you can't set sessions in the same ajax query (if it makes any sense) you could do it wiht mysql/ips but that is too challenging just do a page reload Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294042 Share on other sites More sharing options...
xenon2050 Posted July 10, 2007 Author Share Posted July 10, 2007 Okay well thanks for the ideas... I've never done javascript before but I should be able to figure it out... Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-294764 Share on other sites More sharing options...
xenon2050 Posted July 31, 2007 Author Share Posted July 31, 2007 Okay I want to open this up again for a similar question, because after researching a bit I don't think I asked the right question. Here is a link to a picture representation of what i am looking for. http://www.hanle-productions.com/images/firstpage.png As you can see it is a photography website. In my experience most photographers use flash to great extent. But I would rather not use it at all. What I want to do is have the same background as in the picture but have the picture in the middle be changeable and the links below it be picture based so I can control the font. I've been having a hard time figuring out how I should align the objects. I've never tried putting a picture on a picture. How can I arrange it so all the elements are where they are supposed to be? And how is the best way to set the picture as the background? Should I do what I asked before and have it scaling according to browser size? I've been trying to use CSS to arrange things but I am thinking that I'll need to use other code to get it to work correctly. I know this site will be graphic intensive but the intent is for it to be a good looking site. Can anyone give me ideas on how to do this or better ways to do this? Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-312229 Share on other sites More sharing options...
xenon2050 Posted August 1, 2007 Author Share Posted August 1, 2007 Anyone? Sorry if I'm being a bother, I'm just stumped... Not sure how to do this. Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-312775 Share on other sites More sharing options...
mrjcfreak Posted August 1, 2007 Share Posted August 1, 2007 You are asking a lot of questions! I think what your after is an awful lot of html and css tips- it might be a good idea to google for those, and also have a loook at sites you want to imitate and see how they code them. There are lots of different ways or stacking multiple images up- using a combination of background images and img tags is probably a good plan, but short of designing your site there's not a lot of advice I can think of. (wrt above, GD is an option, albeit an incredibly slow and memory intensive one) Quote Link to comment https://forums.phpfreaks.com/topic/59190-images/#findComment-312779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.