imagefilledellipse 画一椭圆并填充


imagefilledellipse

(PHP 4 >= 4.0.6, PHP 5)

imagefilledellipse画一椭圆并填充

说明

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

imagefilledellipse()image 所代表的图像中以 cxcy(图像左上角为 0, 0)为中心画一个椭圆。wh 分别指定了椭圆的宽和高。椭圆用 color 颜色填充。成功时返回 TRUE, 或者在失败时返回 FALSE.

Example #1 imagefilledellipse() 例子

<?php

// create a blank image
$image imagecreatetruecolor(400300);

// fill the background color
$bg imagecolorallocate($image000);

// choose a color for the ellipse
$col_ellipse imagecolorallocate($image255255255);

// draw the white ellipse
imagefilledellipse($image200150300200$col_ellipse);

// output the picture
header("Content-type: image/png");
imagepng($image);

?>

Note: 此函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。

参见 imageellipse()imagefilledarc()


«  imagefilledarc
» imagefilledpolygon
快速导航

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