标题:php基于GD库,绘制PNG图像Demo 出处:刘新修 时间:Thu, 10 Mar 2016 18:21:08 +0000 作者:刘新修 地址:http://liuxinxiu.com:80/gd-png/ 内容: PHP代码 200;$i--){ //循环10次画出立体效果 imagefilledarc($image, 200, $i, 400, 200, -160, 40, $darknavy, IMG_ARC_PIE); imagefilledarc($image, 200, $i, 400, 200, 40, 75, $darkgray, IMG_ARC_PIE); imagefilledarc($image, 200, $i, 400, 200, 75, 200, $darkred, IMG_ARC_PIE); } imagefilledarc($image, 200, 200, 400, 200, -160, 40, $navy, IMG_ARC_PIE); //画一椭圆弧且填充 imagefilledarc($image, 200, 200, 400, 200, 40 , 75, $gray, IMG_ARC_PIE); //画一椭圆弧且填充 imagefilledarc($image, 200, 200, 400, 200, 75, 200, $red, IMG_ARC_PIE); //画一椭圆弧且填充 imagestring($image, 20, 100, 230, '34.7%', $white); //水平地画一行字符串,依次是F/X/Y/--数值越大向右、向下 imagestring($image, 20, 200, 150, '55.5%', $white); //水平地画一行字符串,依次是F/X/Y/--数值越大向右、向下 //向浏览器中输出一个GIF格式的图片 header('Content-type:image/png'); //使用头函数告诉浏览器以图像方式处理以下输出 imagepng($image); //向浏览器输出 imagedestroy($image); //销毁图像释放资源 //header("Content-type: text/html; charset=utf-8"); //$str="
'$image'
"; //echo $str; ?> gd-png.php PHP代码 180;$i--){ //循环10次画出立体效果 imagefilledarc($image, 187, $i, 360, 180, -160, 40, $darknavy, IMG_ARC_PIE); // imagefilledarc($image, 187, $i, 360, 180, 40, 75, $darkgray, IMG_ARC_PIE); imagefilledarc($image, 187, $i, 360, 180, 75, 200, $darkred, IMG_ARC_PIE); } imagefilledarc($image, 187, 180, 360, 180, -160, 40, $navy, IMG_ARC_PIE); //画一椭圆弧且填充,第一个187-180 是错开7像素 imagefilledarc($image, 187, 180, 360, 180, 40 , 75, $gray, IMG_ARC_PIE); //画一椭圆弧且填充 imagefilledarc($image, 187, 180, 360, 180, 75, 200, $red, IMG_ARC_PIE); //画一椭圆弧且填充 imagestring($image, 20, 180, 130, '55.5%', $white); //水平地画一行字符串,依次是F/X/Y/--数值越大向右、向下 imagestring($image, 20, 100, 200, '34.7%', $white); //水平地画一行字符串,依次是F/X/Y/--数值越大向右、向下 //向浏览器中输出一个GIF格式的图片 //header("Content-type:text/html;charset=utf-8"); // 设置页面的编码风格 header('Content-type:image/png'); //使用头函数告诉浏览器以图像方式处理以下输出--通知浏览器输出的是图像 imagepng($image); //向浏览器输出 imagedestroy($image); //销毁图像释放资源 //header("Content-type: text/html; charset=utf-8"); //$str="
'$image'
"; //echo $str; ?> Generated by Bo-blog 2.1.1 Release