码迷,mamicode.com
首页 > Web开发 > 详细

php基础教程:图像函数举例(3)

时间:2014-06-03 14:49:54      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:des   c   style   class   code   a   

php基础教程:图像函数举例(3)

例二: 阴阳图

 

<?php
$width=400;
$height=400;
$image=imagecreatetruecolor($width,$height);
//提取颜色
$color_black=imagecolorallocate($image,0,2,0);//
$color_white=imagecolorallocate($image,255,255,255);//白色
$color_blue=imagecolorallocate($image,0,0,108);//蓝色
$color_red=imagecolorallocate($image,151,0,4);//红色
$color_my=imagecolorallocate($image,192,192,255);//背景
$color_temp=imagecolorallocate($image,199,199,199);//背景
//作图
imagefill($image,0,0,$color_white);
//第一个是大圆
imagefilledarc ($image,$width/2,$height/2,$height,$height,0,360,$color_blue,IMG_ARC_PIE);
//两个小圆
imagefilledellipse ($image,$width/2,$height/4 ,$height/2,$height/2,$color_red);
imagefilledellipse ($image,$width/2,$height/4 * 3,$height/2,$height/2,$color_blue);
/*imagefilledellipse -- 画一椭圆并填充*/(昆明男科医院)
imagefilledarc ($image,$width/2,$height/2,$height,$height,-90,90,$color_red,IMG_ARC_PIE);
imagefilledellipse ($image,$width/2,$height/4 * 3,$height/2,$height/2,$color_blue);
//发送对象至头
header(‘content-type:image/png‘);
imagepng($image);
/*
//发送对象至文件
$filename="ex1.png";
imagepng($image,$filename);
*/
//销毁对象
imagedestroy($image);
?>

php基础教程:图像函数举例(3),布布扣,bubuko.com

php基础教程:图像函数举例(3)

标签:des   c   style   class   code   a   

原文地址:http://www.cnblogs.com/hengyi123/p/3765237.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!