(PHP 4, PHP 5, PHP 7)
imagecreate — 锟铰斤拷一锟斤拷锟斤拷锟节碉拷色锟斤拷锟酵硷拷锟�
$x_size
, int $y_size
) : resource
imagecreate() 锟斤拷锟斤拷一锟斤拷图锟斤拷锟绞讹拷锟斤拷锟斤拷锟斤拷锟斤拷锟揭伙拷锟斤拷锟叫∥�
x_size
锟斤拷 y_size
锟侥空帮拷图锟斤拷
锟狡硷拷使锟斤拷 imagecreatetruecolor()锟斤拷
Example #1 锟铰斤拷一锟斤拷锟铰碉拷 GD 图锟斤拷锟斤拷锟斤拷锟斤拷锟酵硷拷锟�
<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
锟轿硷拷 imagedestroy() 锟斤拷 imagecreatetruecolor()锟斤拷