Reply to Re: How do you zoom in on an image using PHP?

Your name:

Reply:


Posted by comp.lang.php on 05/05/06 19:58

comp.lang.php wrote:
> re: http://www.phpbuilder.com/columns/pablo19990729.php3
>
> I tried recreating his code (with some modernity considering he's using
> PHP 3 and I'm using PHP 4.3.2 - PHP 5.0.4):
>
> [PHP]
> <?
> if ($_POST['blah']) {
> list($image_width, $image_height) =
> @getimagesize('http://valsignalandet.com/images/stave.jpg');
> $zoomImgObj =
> @imagecreatefromjpeg('http://valsignalandet.com/images/stave.jpg');
> $imageObj = @imagecreatetruecolor($image_width, $image_height);
> $factor=3.75;
> $posx = floor($_POST['val_x'] * $factor - floor((int)($image_width /
> 2)));
> $posy = floor($_POST['val_y'] * $factor - floor((int)($image_height /
> 2)));

[snip]

UPDATE:

I think this is the culprit, because if I click on the upper left hand
corner of the image, I get something LIKE a zoomed-in image but
terribly offset, otherwise, nuthin' but black:

[PHP]
$factor=3.75;
$posx = floor($_POST['val_x'] * $factor - (int)($image_width / 2));
$posy = floor($_POST['val_y'] * $factor - (int)($image_height / 2));
[/PHP]

I suspect the calculations for $posx and $posy are causing it to
happen.. but I don't have any idea how to fix that.

Phil

[Back to original 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

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