Web±à³Ì Readers Blog
create the blog for Web±à³Ì scholars
PHP³£¼ûͼÐβÙ×÷ Íæ×ªÍ¼Ïñº¯Êý¿â(ËÄ) - PHPͼÏñʵÀý¶þ
Submitted by ×÷Õß: admin
2008-08-26 10:45:55
PHPͼÏñʵÀýÈý: 3DͼÏñ--cool ¡¡¡¡
Ö÷ÒªÓõ½µÄPHPͼÏñº¯Êý:imagecreatetruecolor()¡¢imagecolorallocate()¡¢imagefill()¡¢imagefilledellipse(). <?php
$width=400;
$height=400;
$image = imagecreatetruecolor($width, $height);
$white¡¡¡¡= imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$gray¡¡¡¡ = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);
$navy¡¡¡¡ = imagecolorallocate($image, 0x00, 0x00, 0x80);
$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);
$red¡¡¡¡¡¡= imagecolorallocate($image, 0xFF, 0x00, 0x00);
$darkred¡¡= imagecolorallocate($image, 0x90, 0x00, 0x00);
imagefill($image,0,0,$white);
// make the 3D effect
for ($i = $height /2 +20; $i > $height /2; $i--) {
¡¡imagefilledarc($image, $width/2, $i, $width/2, $height /2, 0, 45, $darknavy, IMG_ARC_PIE);
¡¡imagefilledarc($image,¡¡$width/2, $i, $width/2, $height /2, 45, 75 , $darkgray, IMG_ARC_PIE);
¡¡imagefilledarc($image,¡¡$width/2, $i, $width/2, $height /2, 75, 360 , $darkred, IMG_ARC_PIE);
}
imagefilledarc($image, $width/2, $height /2, $width/2, $height /2, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, $width/2, $height /2, $width/2, $height /2, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, $width/2, $height /2, $width/2, $height /2, 75, 360 , $red, IMG_ARC_PIE);
// flush image
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
/*
//·¢ËͶÔÏóÖÁÎļþ
$filename="ex1.png";
imagepng($image,$filename);
*/
?>
·ÖÀà:ÍøÕ¾|PHPѧϰ |
Read more
ÔĶÁ (141)
ÆÀÂÛ (0)
·Ã¿Í ÆÀÂÛ
·¢±íÆÀÂÛ
Óû§µÇ¼
ÈÕÖ¾·ÖÀà©®Category
- ÍøÕ¾|PHPѧϰ [66]
- ÍøÕ¾|ASP±¸Íü [6]
- ÍøÕ¾|JSP½ø½× [3]
- ÍøÕ¾|Êý¾Ý¿âÀà [11]
- С̸|ддÐÄÇé [13]
- ÍøÕ¾|xmlѧϰ [0]
- ÍøÕ¾|Javascriptѧϰ [5]
- ÍøÕ¾|ÃæÏò¶ÔÏó [1]
- ÍøÕ¾|AJAXѧϰ [2]
- ÍøÕ¾|ÔÓÆßÔÓ°Ë [11]
- ÍøÕ¾|½¨Õ¾ÖªÊ¶Í¨µÀ [6]
- ÖÐÇï½Ú|´óÔÓ»° [11]
ÈȵãÎÄÕ©®Articles
- ÔÚTomcatÏÂJSP¡¢Se...
- ²ÉÓÃutf8±àÂë³¹µ×½...
- ÎҵĴóѧͬѧ»ØÒäÂ...
- ¸Ðл×î½üÔÚѧϰÉϰ...
- mysqlÊý¾Ý¿âµÄµ¼Èë...