標籤: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);?>