rejected 0 Report post Posted July 16, 2005 I'm trying to create a script that writes text to an image. header("Content-type: image/png");$_phrases = array("Test 1","Test 2","Test 3","Test 4","etc.");$_rand_phrase = $_phrases[rand(0,count($_phrases)-1)];$_image = imagecreatefrompng("gmail.png");$_user_width = imaagettfbbox(9,0,"tahoma.ttf",$_rand_phrase);$_x_value = (200-($user_width[2] + 113));$_color = imagecolorallocate($_image, 165, 164, 164);imagettftext($_image, 9, 0, $_x_value, 16, $_color, "tahoma.ttf", $_rand_phrase);imagepng($_image);imagedestroy($_image);I can't see what I'm doing wrong.. I know it should work, I'm making a dumb mistake of some sort.Can anyone help? Share this post Link to post Share on other sites
rvalkass 5 Report post Posted July 16, 2005 I just made a similar script for a friend, one of those interactive sigs with the IP and all that on it. Anyway, try using imagestring($_image, 3, 6, 6, $Title, $clr_black);//It works like this:imagestring($_image, FONT, X-POSITION, Y-POSITION, TEXT-TO-DISPLAY, COLOUR); rather than imagettftext.Also, try removing the _ from the variables as I have seen that confuse some set ups of PHP before.What exact error do you get when you run the script, or do you just get a blank page? Share this post Link to post Share on other sites
snlildude87 0 Report post Posted July 16, 2005 If you want to make dynamic sigs, you could follow SystemWisdom's tutorial: http://forums.xisto.com/topic/24458-php-dynamic-signatures-using-the-gd-module-and-mysql/ Share this post Link to post Share on other sites
rejected 0 Report post Posted July 16, 2005 Thanks, about to try rvalkass's and then if it fails I'll try that tutorial Nguyen.There isn't an error, it just says that the iamge can't be displayed because it was errors. Share this post Link to post Share on other sites
snlildude87 0 Report post Posted July 16, 2005 (edited) and then if it fails I'll try that tutorial Nguyen. 162095[/snapback] Oh no. Are you calling me "Nguyen", too?? Sorry! I clicked edit instead of post.. Edited July 16, 2005 by rejected (see edit history) Share this post Link to post Share on other sites
rejected 0 Report post Posted July 16, 2005 Sorry about that...darn edit button..I'll only call you Nguyen if allowed..if not I'll call you Guy B)And thanks for the link to the tut, it helped me fix one of my problems Share this post Link to post Share on other sites