What is Web±à³Ì Readers Blog?

    Web±à³Ì Readers Blog¼¯ÖÐÁËWeb×ÊÉî³ÌÐòÔ±µÄ¼¼ÇɺÍʵս¾­Ñ飬º­¸ÇÁËWeb±à³ÌµÄÈ«²¿·¶Î§: 3P(ASP, JSP, PHP) web±à³Ì¼¼Êõ£¬MySQLÊý¾Ý¿â¿ª·¢£¬·þÎñÆ÷ÍøÂ簲ȫºÍDIV+CSS²¼¾ÖµÈ£¬ÌṩһЩÓÅÐãµÄ±à³ÌÔ´Â룬ʹÄúµÄWeb±à³Ìѧϰ֮·¸ü¼Óƽ̹¡£

ä¯ÀÀģʽ: ±ê×¼ | Áбí

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³£¼ûͼÐβÙ×÷ Íæ×ªÍ¼Ïñº¯Êý¿â

·ÖÀà:ÍøÕ¾|PHPѧϰ | Read more ÔĶÁ (141) ÆÀÂÛ (0)





·Ã¿Í ÆÀÂÛ





·¢±íÆÀÂÛ

êÇ¡¡³Æ (±ØÌî)

ÓÊ¡¡Ïä (±ØÌî)

Íø Õ¾

ÑéÖ¤Âë: (±ØÌî)