Imagecreatetruecolor () after creating a true color image,
The first color registered by the imagecolorallocate () method is not automatically used as the background color, but must be filled with imagefill ().
// Set the color
$ Bg = imagecolorallocate ($ im, 240,240, 0); // set the background color.
Imagefill ($ im, $ bg); // loads the background color
$ Te = imagecolorallocate ($ im, 0, 0, 0); // string color
// Add the string to the image
Imagestring ($ im, rand (3, 6), rand (5, 60), rand (5, 15), $ rand, $ te );
// Output image
Header ("Content-type: image/jpeg ");
Imagejpeg ($ im );
Imagecreatetruecolor () returns an image identifier representing a black image of the specified size.
Based on the Function Definition in your PHP and GD versions. For PHP 4.0.6, the function 4.1.x always exists.
For more details, see php tutorial er/24/php-imagecreatetruecolor.htm> http://www.bKjia. c0m/phper/24/php-imagecreatetruecolor.htm