imagefilledellipse
(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
imagefilledellipse — 绘制椭圆并填充
说明
imagefilledellipse(
GdImage
int
int
int
int
int
): bool
GdImage
$image,int
$center_x,int
$center_y,int
$width,int
$height,int
$color): bool
在指定 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()。
参见
- imageellipse() - 画椭圆
- imagefilledarc() - 绘制部分弧形并填充