stickdragon
Thu 27 December 2007, 02:12 am GMT +0200
been playing around with the image functions and ran into a small wall..
while using imagecreatetruecolor i can use imagettftext fine with no errors, but if i add imagettftext i get
what do you need to do to use imagettftext from the imagecreatefrompng?
while using imagecreatetruecolor i can use imagettftext fine with no errors, but if i add imagettftext i get
Quote
The image “test.php” cannot be displayed, because it contains errors.
what do you need to do to use imagettftext from the imagecreatefrompng?
Code:
<?php
header('Content-Type: image/png');
$im = @imagecreatefrompng("test.png");
$black = imagecolorallocate($im, 255, 255, 255);
imageline($im, 40, 62, 117, 62, $black);
imagettftext($im, 8, 0, 40, 60, $black, $font, 'test..');
imagepng($im);
?>
header('Content-Type: image/png');
$im = @imagecreatefrompng("test.png");
$black = imagecolorallocate($im, 255, 255, 255);
imageline($im, 40, 62, 117, 62, $black);
imagettftext($im, 8, 0, 40, 60, $black, $font, 'test..');
imagepng($im);
?>