imagefilledellipse
(PHP 4 >= 4.0.6, PHP 5)
imagefilledellipse -- 画一椭圆并填充
说明
bool
imagefilledellipse ( resource image, int cx, int cy, int w, int h, int color )
imagefilledellipse() 在
image
所代表的图像中以
cx
,cy
(图像左上角为
0, 0)为中心画一个椭圆。w
和 h
分别指定了椭圆的宽和高。椭圆用 color
颜色填充。如果成功则返回 TRUE,失败则返回 FALSE。
例 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);
?>
|
|
注意: 本函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。
参见 imageellipse() 和
imagefilledarc()。