php中怎么给图片填充颜色呢?
php中用来给图片填充颜色的相关函数有这么两个:[*]imagecolorallocate() --给图片配色,返回的是一个整形数值[*]imagefill() --给图片填充一种配色使用方法,摘抄php手册上的示例代码如下:$im = imagecreatetruecolor(100, 100);// sets background to red$red = imagecolorallocate($im, 255, 0, 0);imagefill($im, 0, 0, $red);header('Content-type: image/png');imagepng($im);imaged...全部
php中用来给图片填充颜色的相关函数有这么两个:[*]imagecolorallocate() --给图片配色,返回的是一个整形数值[*]imagefill() --给图片填充一种配色使用方法,摘抄php手册上的示例代码如下:$im = imagecreatetruecolor(100, 100);// sets background to red$red = imagecolorallocate($im, 255, 0, 0);imagefill($im, 0, 0, $red);header('Content-type: image/png');imagepng($im);imagedestroy($im); 查看原帖>>。
收起