imagefilledarc

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

imagefilledarc锟斤拷一锟斤拷圆锟斤拷锟斤拷锟斤拷锟�

说锟斤拷

imagefilledarc ( resource $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锟斤拷锟斤拷

  1. IMG_ARC_PIE
  2. IMG_ARC_CHORD
  3. IMG_ARC_NOFILL
  4. 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(100100);

// 锟斤拷锟斤拷一些锟斤拷色
$white    imagecolorallocate($image0xFF0xFF0xFF);
$gray     imagecolorallocate($image0xC00xC00xC0);
$darkgray imagecolorallocate($image0x900x900x90);
$navy     imagecolorallocate($image0x000x000x80);
$darknavy imagecolorallocate($image0x000x000x50);
$red      imagecolorallocate($image0xFF0x000x00);
$darkred  imagecolorallocate($image0x900x000x00);

// 锟斤拷锟斤拷 3D 效锟斤拷
for ($i 60$i 50$i--) {
   
imagefilledarc($image50$i10050045$darknavyIMG_ARC_PIE);
   
imagefilledarc($image50$i100504575 $darkgrayIMG_ARC_PIE);
   
imagefilledarc($image50$i1005075360 $darkredIMG_ARC_PIE);
}

imagefilledarc($image505010050045$navyIMG_ARC_PIE);
imagefilledarc($image5050100504575 $grayIMG_ARC_PIE);
imagefilledarc($image50501005075360 $redIMG_ARC_PIE);


// 锟斤拷锟酵硷拷锟�
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟揭� 3D 效锟斤拷锟侥憋拷状图

注锟斤拷

Note: 锟剿猴拷锟斤拷锟斤拷要 GD 2.0.1 锟斤拷锟斤拷甙姹�(锟狡硷拷 2.0.28 锟斤拷锟斤拷锟竭版本)锟斤拷