PHP imagearc - 畫橢圓弧
imagearc — 用于畫橢圓弧。
語法
bool imagearc ( resource $image , int $cx , int $cy , int $w , int $h , int $s , int $e , int $color )
imagearc() 以 cx,cy(圖像左上角為 0, 0)為中心在 image 所代表的圖像中畫一個橢圓弧。
w 和 h 分別指定了橢圓的寬度和高度,起始和結束點以 s 和 e 參數(shù)以角度指定。0°位于三點鐘位置,以順時針方向繪畫。
實例
<?php $img = imagecreatetruecolor(200, 200);// 創(chuàng)建一個 200*200 圖片 $white = imagecolorallocate($img, 255, 255, 255); // 顏色 // 畫橢圓弧 imagearc($img, 140, 75, 50, 50, 0, 360, $white); // 瀏覽器輸出圖片 header("Content-type: image/png"); imagepng($img); imagedestroy($img); ?>
以上實例輸出結果的圖片如下:

更多建議: