array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.imagefilledellipse.php', 1 => 'imagefilledellipse', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD 和图像处理 函数', ), 'prev' => array ( 0 => 'function.imagefilledarc.php', 1 => 'imagefilledarc', ), 'next' => array ( 0 => 'function.imagefilledpolygon.php', 1 => 'imagefilledpolygon', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/image/functions/imagefilledellipse.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
imagefilledellipse — 绘制椭圆并填充
$image
,$center_x
,$center_y
,$width
,$height
,$color
在指定 image
上以指定坐标为中心绘制椭圆。
image
由图象创建函数(例如imagecreatetruecolor())返回的 GdImage 对象。
center_x
中央的 x 坐标。
center_y
中央的 y 坐标。
width
椭圆的宽度。
height
椭圆的高度。
color
填充颜色。颜色标识符使用 imagecolorallocate() 创建。
示例 #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);
?>
以上示例的输出类似于:
注意:
imagefilledellipse() 忽略 imagesetthickness()。