从图片创建创建图片 imagecreatefromjpeg("a.jpg")
自绘图片:
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
$im = imagecreatetruecolor(150, 30); /* Create a blank image */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
/* 在图片中显示字符串 */
imagestring($im, 1, 5, 5, "your text", $tc);
输出图片:
header('Content-Type: image/png');
imagepng($im);
最后撤销图片资源:
ImageDestroy($im);