(PHP 4 >= 4.0.6, PHP 5, PHP 7)
imagefilledarc — 锟斤拷一锟斤拷圆锟斤拷锟斤拷锟斤拷锟�
$image
, int $cx
, int $cy
, int $width
, int $height
, int $start
, int $end
, int $color
, int $style
) : bool锟斤拷指锟斤拷锟斤拷 image
锟较伙拷一锟斤拷圆锟斤拷锟斤拷锟斤拷洹�
image
锟斤拷图锟襟创斤拷锟斤拷锟斤拷(锟斤拷锟斤拷imagecreatetruecolor())锟斤拷锟截碉拷图锟斤拷锟斤拷源锟斤拷
cx
锟叫硷拷锟� x 锟斤拷锟疥。
cy
锟叫硷拷锟� y 锟斤拷锟疥。
width
锟斤拷圆锟斤拷锟侥匡拷取锟�
height
锟斤拷圆锟斤拷锟侥高度★拷
start
锟斤拷锟角度★拷
end
锟秸碉拷嵌取锟� 0锟斤拷 is located at the three-o'clock position, and the arc is drawn clockwise.
color
imagecolorallocate() 锟斤拷锟斤拷锟斤拷锟斤拷色锟斤拷识锟斤拷锟斤拷
style
值锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷值锟侥帮拷位锟斤拷OR锟斤拷锟斤拷
IMG_ARC_PIE
IMG_ARC_CHORD
IMG_ARC_NOFILL
IMG_ARC_EDGED
IMG_ARC_PIE
锟斤拷 IMG_ARC_CHORD
锟角伙拷锟斤拷模锟�IMG_ARC_CHORD
只锟斤拷锟斤拷直锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷始锟酵斤拷锟斤拷锟姐,IMG_ARC_PIE
锟斤拷锟斤拷锟皆诧拷伪呓纭�IMG_ARC_NOFILL
指锟斤拷锟斤拷锟斤拷锟斤拷只锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷洹�IMG_ARC_EDGED
指锟斤拷锟斤拷直锟竭斤拷锟斤拷始锟酵斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥碉拷锟斤拷锟斤拷锟斤拷锟斤拷 IMG_ARC_NOFILL
一锟斤拷使锟斤拷锟角伙拷锟斤拷状图锟斤拷锟斤拷锟侥好凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷洌╋拷锟�
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 锟斤拷锟斤拷一 3D 效锟斤拷锟侥憋拷状图
<?php
// 锟斤拷锟斤拷图锟斤拷
$image = imagecreatetruecolor(100, 100);
// 锟斤拷锟斤拷一些锟斤拷色
$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);
// 锟斤拷锟斤拷 3D 效锟斤拷
for ($i = 60; $i > 50; $i--) {
imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);
imagefilledarc($image, 50, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);
imagefilledarc($image, 50, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);
}
imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE);
// 锟斤拷锟酵硷拷锟�
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
Note: 锟剿猴拷锟斤拷锟斤拷要 GD 2.0.1 锟斤拷锟斤拷甙姹�(锟狡硷拷 2.0.28 锟斤拷锟斤拷锟竭版本)锟斤拷