imageellipse
(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
imageellipse — 畫一個橢圓
說明
imageellipse(
resource
int
int
int
int
int
): bool
resource
$image,int
$cx,int
$cy,int
$width,int
$height,int
$color): bool
在指定的座標上畫一個橢圓。
參數
-
image -
由圖像建立函式(例如imagecreatetruecolor())返回的 GdImage 對象。
-
cx -
中間的 X 座標。
-
cy -
中間的 Y 座標。
-
width -
橢圓的寬度。
-
height -
橢圓的高度。
-
color -
橢圓的顏色。顏色識別符號由 imagecolorallocate() 建立。
返回值
成功時返回 true, 或者在失敗時返回 false。
範例
示例 #1 imageellipse() 例子
<?php
// 新建一個空白影象
$image = imagecreatetruecolor(400, 300);
// 填充背景色
$bg = imagecolorallocate($image, 0, 0, 0);
// 選擇橢圓的顏色
$col_ellipse = imagecolorallocate($image, 255, 255, 255);
// 畫一個橢圓
imageellipse($image, 200, 150, 300, 200, $col_ellipse);
// 輸出影象
header("Content-type: image/png");
imagepng($image);
?>
以上例程的輸出類似於:
註釋
注意:
本函式需要 GD 2.0.2 或更高版本。