Imagecreatetruecolor () returns an image identifier representing a black image of the specified size.
According to your php tutorial and function definition in the gd version. For php 4.0.6, the function 4.1.x always exists.
,
*/
$ Im = imagecreatetruecolor (100,100); // create an image
$ String = 'n'; // defines the character
$ White = imagecolorallocate ($ im, 255,255,255); // defines white
$ Black = imagecolorallocate ($ im, 0); // defines the black
$ Red = imagecolorallocate ($ im, 255, 0, 0); // defines the red color.
// Output a black "z" on the white background, which is actually inverted n
Imagecharup ($ im, 6,20, 20, $ string, $ white );
Imagechar ($ im, 40, "r", $ red); // draw characters in red
Header ('content-type: image/png '); // output header information
Imagepng ($ im); // output png file
Imagedestroy ($ im); // destroy the image
//
$ Img = imagecreatetruecolor (400,400); // create an image
$ White = imagecolorallocate ($ img, 255,255,255); // defines white
$ Black = imagecolorallocate ($ img, 0); // defines the black
Imagearc ($ img, 200,200,350,350, 0,360, $ white); // draw an elliptical arc
Header ("content-type: image/png"); // output header information
Imagepng ($ img); // output as png Image
Imagedestroy ($ img); // destroy the image
//
$ Size = 300;
$ Image = imagecreatetruecolor ($ size, $ size );
// Draw a box with a white background and a black border
$ Back = imagecolorallocate ($ image, 255,255,255 );
$ Border = imagecolorallocate ($ image, 0, 0 );
Imagefilledrectangle ($ image, 0, 0, $ size-1, $ size-1, $ back );
Imagerectangle ($ image, 0, 0, $ size-1, $ size-1, $ border );
$ Yellow_x = 100;
$ Yellow_y = 75;
$ Red_x = 120;
$ Red _y = 165;
$ Blue_x = 187;
$ Blue _ y = 125;
$ Radius = 150;
// Assign some colors with the alpha Value
$ Yellow = imagecolorallocatealpha ($ image, 255,255 );
$ Red = imagecolorallocatealpha ($ image, 0 );
$ Blue = imagecolorallocatealpha ($ image );
// Draw three overlapping circles
Imagefilledellips tutorial e ($ image, $ yellow_x, $ yellow_y, $ radius, $ radius, $ yellow );
Imagefilledellipse ($ image, $ red_x, $ red_y, $ radius, $ radius, $ red );
Imagefilledellipse ($ image, $ blue_x, $ blue_y, $ radius, $ radius, $ blue );
// Output header
Header ('content-type: image/png ');
// Final output result
Imagepng ($ image );
Imagedestroy ($ image );
//
$ Im = imagecreate (100,100); // create an image
$ String = 'php'; // define a string
$ Bg = imagecolorallocate ($ im, 255,255,255); // defines white
$ Black = imagecolorallocate ($ im, 0); // defines the black
// Output the specified character in the upper left corner.
Imagechar ($ im, 1, 0, 0, $ string, $ black );
Header ('content-type: image/png '); // output header information
Imagepng ($ im); // output png file
Imagedestroy ($ im); // destroy the image
?>