(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
imagecreatetruecolor — 新建真彩色图像
imagecreatetruecolor() 返回图像对象,表示指定大小的黑色图像。
width图像宽度。
height图像高度。
成功后返回图象对象,失败后返回 false。
| 版本 | 说明 | 
|---|---|
| 8.0.0 | 成功时,此函数现在返回 GDImage 实例;之前返回 resource。 | 
示例 #1 新建 GD 图像流并输出图像。
<?php
header ('Content-Type: image/png');
$im = @imagecreatetruecolor(120, 20)
      or die('Cannot Initialize new GD image stream');
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
imagepng($im);
imagedestroy($im);
?>
以上例程的输出类似于:
 
     