|
imagearc (PHP 3, PHP 4, PHP 5) 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
參數以角度指定。0°位於三點鐘位置,以順時針方向繪畫。
例子 1. 用 imagearc() 畫一個圓
<?php // 建立一個 200X200 的圖像 $img = imagecreatetruecolor(200, 200); // 配置彩色 $white = imagecolorallocate($img, 255, 255, 255); $black = imagecolorallocate($img, 0, 0, 0); // 畫一個黑色的圓 imagearc($img, 100, 100, 150, 150, 0, 360, $black); // 將圖像輸出到瀏覽器 header("Content-type: image/png"); imagepng($img); // 釋放記憶體 imagedestroy($img); ?>
|
|
參見 imageellipse(),imagefilledellipse()
和 imagefilledarc()。
| |