Imagecreatetruecolor () After creating a true color image,
The first color that is registered with the Imagecolorallocate () method is not automatically used as the background color, but must be filled with imagefill ().
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 the black image of the specified size.
According to your PHP and GD version of the function definition 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.bkjia.c0m/phper/24/php-imagecreatetruecolor.htm
http://www.bkjia.com/PHPjc/632973.html www.bkjia.com true http://www.bkjia.com/PHPjc/632973.html techarticle Imagecreatetruecolor () After creating a true color image, the first color of the Imagecolorallocate () method is not automatically registered as the background color, but must be filled/set with Imagefill () ...