tonelm54
asked on
GD Rotate not working
Im trying to simply rotate some text by 15 degrees, but I cant get it working at all despite multiple debug lines
My simplified code I dont think I could get more simpler, what Ive done is:-
Any idea what Im doing wrong?
My simplified code I dont think I could get more simpler, what Ive done is:-
<?php
header('Content-Type: image/png');
$im = imagecreatetruecolor(300, 150);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 300, 150, $white);
$text = 'Testing...';
$font = 'arial.ttf';
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
imagerotate($im, 15, 0);
imagepng($im);
imagedestroy($im);
?>
Any idea what Im doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Try installing "imagick" and restarted apache.
Try installing "imagick" and restarted apache.
http://php.net/manual/en/function.imagerotate.php
I can see how this can be confusing, since many of the other image functions mutate a resource and return something like a boolean, but that is the unfortunate nature of PHP - it's hard to guess what will be changed or returned without reference to the manual. Example of a related function:
http://php.net/manual/en/function.imagesetinterpolation.php