php中用gd库怎么做出太极的图案,求代码

2025-04-14 23:11:48
推荐回答(2个)
回答1:

看代码

	$w = 500;
$h = 500;
$img = imageCreate($w,$h);
imageColorAllocate($img,230,230,230);
$white = imageColorAllocate($img,255,255,255);
$black = imageColorAllocate($img,0,0,0);
imageFilledArc($img,250,250,500,500,0,360,$black,IMG_ARC_PIE);
imageFilledArc($img,250,250,500,500,90,270,$white,IMG_ARC_PIE);

imageFilledArc($img,250,375,250,250,0,360,$black,IMG_ARC_PIE);
imageFilledArc($img,250,125,250,250,0,360,$white,IMG_ARC_PIE);

imageFilledArc($img,250,375,50,50,0,360,$white,IMG_ARC_PIE);
imageFilledArc($img,250,125,50,50,0,360,$black,IMG_ARC_PIE);

header("content-type:image/png");
imagePNG($img);
?>

这是我刚发布的,带注释的

http://www.xstnet.com/article-77.html

这是效果图

回答2:

煮豆燃豆萁,豆在釜中泣.