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]
|