imageellipse
(PHP 4 >= 4.0.6, PHP 5, PHP 7)
imageellipse - 绘制一个椭圆
描述
bool imageellipse ( resource $image , int $cx , int $cy , int $width , int $height , int $color )
绘制以指定坐标为中心的椭圆。
参数
`image`
一个图像资源,由图像创建函数之一返回,如imagecreatetruecolor()。
cx
中心的x坐标。
cy
中心的y坐标。
width
椭圆宽度。
height
椭圆高度。
color
椭圆的颜色。使用imagecolorallocate()创建的颜色标识符。
返回值
返回TRUE
成功或失败时返回FALSE
。
例子
Example #1 imageellipse() example
<?php
//?Create?a?blank?image.
$image?=?imagecreatetruecolor(400,?300);
//?Select?the?background?color.
$bg?=?imagecolorallocate($image,?0,?0,?0);
//?Fill?the?background?with?the?color?selected?above.
imagefill($image,?0,?0,?$bg);
//?Choose?a?color?for?the?ellipse.
$col_ellipse?=?imagecolorallocate($image,?255,?255,?255);
//?Draw?the?ellipse.
imageellipse($image,?200,?150,?300,?200,?$col_ellipse);
//?Output?the?image.
header("Content-type:?image/png");
imagepng($image);
?>
上面的例子会输出类似于:
注释
注意: imageellipse()会忽略imagesetthickness()。
← imagedestroy
imagefill →
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com