首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

imageellipse

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

imageellipse - 绘制一个椭圆

描述

代码语言:javascript
复制
bool imageellipse ( resource $image , int $cx , int $cy , int $width , int $height , int $color )

绘制以指定坐标为中心的椭圆。

参数

代码语言:txt
复制
`image`   

一个图像资源,由图像创建函数之一返回,如imagecreatetruecolor()。

cx

中心的x坐标。

cy

中心的y坐标。

width

椭圆宽度。

height

椭圆高度。

color

椭圆的颜色。使用imagecolorallocate()创建的颜色标识符。

返回值

返回TRUE成功或失败时返回FALSE

例子

Example #1 imageellipse() example

代码语言:javascript
复制
<?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 →

扫码关注腾讯云开发者

领取腾讯云代金券