|
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
Navigation:
[Reply to this message]
|