This question already has an answer here:
iam sure it's simple, but i still very beginner at this. there is a php function called ImageString, it's the only function that i can use to convert text into images, i don't know why, but even any script (copy paste) from the php manual wont work with me.
All i want is to change the font size to something bigger than 5.
this is my code
header ("Content-type: image/jpeg");
// imagecreate (x width, y width)
$img_handle = imagecreatetruecolor (800, 600) or die ("Cannot Create image");
// ImageColorAllocate (image, red, green, blue)
$back_color = ImageColorAllocate ($img_handle, 0, 0, 0);
$txt_color = ImageColorAllocate ($img_handle, 243,203,146);
imagecolortransparent($img_handle, $back_color);
$text = 'soem text goes here';
ImageString($img_handle, 40, 10,90, $text, $txt_color);
Imagejpeg ($img_handle);
ImageDestroy($img_handle);
</div>
You use capitals in the function names. Use imagecolorallocate
instead of ImageColorAllocate
.
Same for ImageString
, Imagejpeg
and ImageDestroy
, they all need to be lowercase.
same technique as we do while generating a captcha image might work.