imageellipse 画一个椭圆 php函数


imageellipse

(PHP 4 >= 4.0.6, PHP 5)

imageellipse画一个椭圆

说明

bool imageellipse ( resource $image , int $cx , int $cy , int $w , int $h , int $color )

imageellipse()image 所代表的图像中画一个中心为 cxcy(图像左上角为 0, 0)的椭圆。wh 分别指定了椭圆的宽度和高度,椭圆的颜色由 color 指定。

Note:

本函数添加于 PHP 4.0.6 且需要 GD 2.0.2 或更高版本,可以在 » http://www.libgd.org/ 获得。

Example #1 imageellipse() 例子

<?php

// 新建一个空白图像
$image imagecreatetruecolor(400300);

// 填充背景色
$bg imagecolorallocate($image000);

// 选择椭圆的颜色
$col_ellipse imagecolorallocate($image255255255);

// 画一个椭圆
imageellipse($image200150300200$col_ellipse);

// 输出图像
header("Content-type: image/png");
imagepng($image);

?>

参见 imagefilledellipse()imagearc()


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3