导航首页 » 技术教程 » PHP:imageellipse()的用法_GD库图像处理函数
PHP:imageellipse()的用法_GD库图像处理函数 150 2023-12-15   

imageellipse

(PHP 4 >= 4.0.6, PHP 5)

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() 例子

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


?>

以上例程的输出类似于:

注释

Note:

本函数需要 GD 2.0.2 或更高版本。

参见

imagefilledellipse() - 画一椭圆并填充 imagearc() - 画椭圆弧


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103