You are here: Re: How do I resize an image to a given window size? « PHP Programming Language « IT news, forums, messages
Re: How do I resize an image to a given window size?

Posted by Rik on 01/26/07 21:37

Robert S <robert.spam.me.senseless@gmail.com> wrote:

>> To make this stuff work you write the code in java, and their compiler
>> turns (the required client side
>> portions) into javascript for you.
>
> Sorry - I didn't make myself clear on my original post. I've managed
> to do the javascript code that calculates the size of the window and
> sends it back to the server. I want the PHP code that adjusts the
> image to the dimensions supplied by javascript.

By supplying PHP with the height & width, preferably as GET variables.
Then you can use the function imagecopyresampled to scale the image as
needed. See the examples at http://nl2.php.net/imagecopyresampled.

Just set the src of the image to be the php script, imagejpg/-png/-gif
will send the resized image back to the browser as long as you don't
specify a filename.
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация