imageellipse

(PHP 4 >= 4.0.6, PHP 5)

imageellipse -- 画一个椭圆

说明

bool imageellipse ( resource image, int cx, int cy, int w, int h, int color )

imageellipse()image 所代表的图像中画一个中心为 cxcy(图像左上角为 0, 0)的椭圆。wh 分别指定了椭圆的宽度和高度,椭圆的颜色由 color 指定。

注意: 本函数添加于 PHP 4.0.6 且需要 GD 2.0.2 或更高版本,可以在 http://www.libgd.org/ 获得。

例 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);

?>

参见 imagefilledellipse()imagearc()