1
我真的有一個問題,找出如何解決這個問題。我似乎無法改變黑色的背景。這怎麼可能?字符串圖像只產生黑色背景
$string = "foo";
$font = 4;
$width = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font);
$im = @imagecreatetruecolor ($width,$height);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 0, 0, $string, $textcolor);
imagegif($im, 'somefile.gif', 8);
imagedestroy($im);
imagegif($ IM, 'somefile.gif',8); 可能B第二個參數需要完整路徑,這裏沒有路徑,它只有文件名......只是剔出來...... – 2010-04-16 10:27:35