(PHP 4 >= 4.0.6, PHP 5)
imagefilledellipse — 畫一橢圓并填充
說明
bool imagefilledellipse ( resource$image
, int $cx
, int $cy
, int $width
, int $height
, int $color
)
畫一橢圓并填充到指定的 image
。
參數(shù)
image
由圖象創(chuàng)建函數(shù)(例如imagecreatetruecolor())返回的圖象資源。
cx
中央的 x 坐標(biāo)。
cy
中央的 y 坐標(biāo)。
width
橢圓的寬度。
height
橢圓的高度。
color
要填充的顏色。顏色標(biāo)識(shí)由函數(shù) imagecolorallocate() 創(chuàng)建。
返回值
成功時(shí)返回 TRUE
, 或者在失敗時(shí)返回 FALSE
。
范例
Example #1 imagefilledellipse() 例子
<?php
// create a blank image
$image = imagecreatetruecolor(400, 300);
// fill the background color
$bg = imagecolorallocate($image, 0, 0, 0);
// choose a color for the ellipse
$col_ellipse = imagecolorallocate($image, 255, 255, 255);
// draw the white ellipse
imagefilledellipse($image, 200, 150, 300, 200, $col_ellipse);
// output the picture
header("Content-type: image/png");
imagepng($image);
?>
以上例程的輸出類似于:
注釋
Note: 此函數(shù)需要 GD 2.0.1 或更高版本(推薦 2.0.28 及更高版本)。
參見
imageellipse() - 畫一個(gè)橢圓 imagefilledarc() - 畫一橢圓弧且填充