Imagecreatetruecolor () Creates a true color image,
Does not automatically register the first color of the Imagecolorallocate () method as the background color, but must use Imagefill () to populate
Set color
$BG = Imagecolorallocate ($im, 240, 240, 0);/Set Background color
Imagefill ($im, 0,0, $BG);/load Background color
$te = imagecolorallocate ($im, 0, 0, 0);//String color
Add a string to the picture
Imagestring ($im, Rand (3,6), Rand (5,60), Rand (5,15), $rand, $te);
Output picture
Header ("Content-type:image/jpeg");
Imagejpeg ($im);
Imagecreatetruecolor () returns an image identifier representing a black image of the specified size.
According to your PHP and GD version of the function defined or not. For PHP 4.0.6 through 4.1.x This function always exists
For more details please see: PHP tutorial Er/24/php-imagecreatetruecolor.htm ">http://www.111cn.net/phper/24/php-imagecreatetruecolor.htm