Forum Moderators: coopster
$text = $_SESSION['username'];
$width = 23 * strlen($text);
$im = @imagecreate ($width,30)or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 150, 174, 101);
$text_color = imagecolorallocate($im, 225,225, 225);
$black = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, 20, 0, 0, 20, $black, "arial.ttf", $text);
imagepng($im);
imagedestroy($im);
the only problem is that the length of the text is really off sometimes...
is there anyway i can sort this out?
[php.net...]