Posted by Jerry Stuckle on 01/26/07 13:07
Robert S wrote:
> I am writing an image viewer. I want to be able to resize the image so
> that it always fits within a window of given height and width.
>
> I've tried a couple of these from the web, but the don't seem to take
> into account both the image dimensions AND the window dimensions.
>
> Are there any algorithms out there? I'm not keen on reinventing the
> wheel here.
>
It can't be done in PHP. PHP is server-side only, and knows nothing
about the window dimensions. You would have to use a client-side
scripting language such as javascript to send the information to the
server, then have a program resize based on the javascript input.
But you'll still have problems if the user resizes the window while your
page is displayed.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|