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(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);
?>

�������̵���������ڣ�

�������������һ 3D Ч���ı�״ͼ

ע��

Note: �˺�����Ҫ GD 2.0.1 ����߰汾(�Ƽ� 2.0.28 �����߰汾)��