PHP 中的 imagefilledellipse() 函数
imagefilledellipse() 函数用于绘制一个填充的椭圆。
语法
imagefilledellipse( $img, $cx, $cy, $width, $height, $color )
参数
img 使用 imagecreatetruecolor() 创建一个空白图像
cx 圆心的 x 坐标。
cy 圆心的 y 坐标。
width 椭圆宽度。
height 椭圆高度。
color 填充颜色。
返回
imagefilledellipse() 函数在成功时返回 TRUE,失败时返回 FALSE。
示例
以下是一个示例
<?php
$img = imagecreatetruecolor(450, 290);
$bgColor = imagecolorallocate($img, 140, 180, 140);
imagefill($img, 0, 0, $bgColor);
$ellipse = imagecolorallocate($img, 120, 50, 70);
imagefilledellipse($img, 225, 150, 400, 250, $ellipse);
header("Content-type: image/png");
imagepng($img);
?>输
以下是输出

Advertisement 广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP