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


Удаленная работа для программистов  •  Как заработать на 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

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