Hi all!
Been a lonng time but I am back with more questions!
Fiddling with GD2 and trying to write text on an image using different fonts.
Using this code:
<?php
// Set the content-type
header("Content-type: image/png");
// Create the image
$im = @imagecreatefrompng("images/13.png");
// Create some colors
$col= imagecolorallocate($im,255,0, 0);
// The text to draw
$text = 'Some Text';
$font = 'fonts/arial.ttf';
// imagettftext ( resource image, float size, float angle, int x, int y, int color, string fontfile, string text )
imagettftext($im, 16, 0, 1, 1, $col, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>
All I get is the image (350px x 75px in PNG format) but no text anywhere!!
Any help very greatly appreciated🙂
(Page is http://www.fatboy.me.uk/gdstuff/test.php)
ry