关于这段代码提示的错误
<?php
//在线拍照设置
//相框所在文件夹名
$width = (int)$_POST["width"];
$height = (int)$_POST["height"];
$colors =(int)$_POST["image"];
function hex2rgb($color)
{
return array(hexdec(substr($color, 0, 2)), hexdec(substr($color, 2, 2)), hexdec(substr($color, 4, 2)));
}
$im = imagecreatetruecolor($width, $height);
imagecolorallocate($im, 255, 255, 255);
$pixs = explode(",", $colors);
array_pop($pixs);
$x = 0;
$y = 0;
$im1 = imagecreate(1, 1);
foreach ($pixs as $p)
{
list($r, $g, $b) = hex2rgb($p);
$_color = imagecolorallocate($im, $r, $g, $b);
imagesetpixel($im, $x, $y, $_color);
$x ++;
if ($x == $width)
{
$x = 0;
$y += 1;
}
}
$filename=time().".jpg";
if(!imagejpeg($im,"image/".$filename)){
echo "图片生成错误";
}
Header("location: pttsave.asp?filename={$filename}");
?>
提示错误: Fatal error: Call to undefined function imagecreatetruecolor() in G:\xiuwo\ds\dsf\dsf\dsfptt\upload.php on line 14