php imageellipse()函数
|
php imageellipse()函数绘制以指定坐标为中心的椭圆。 语法PHP imageellipse()函数具有以下语法。 bool imageellipse(resource $image,int $cx,int $cy,int $width,int $height,int $color ) 参数PHP imageellipse()函数具有以下参数。 image - 由图像创建函数(如imagecreatetruecolor())返回的图像资源。 cx - 中心的x坐标。 中心的cy-y坐标。 width - 椭圆宽度。 height - 椭圆高度。 color - 椭圆的颜色。使用imagecolorallocate()创建的颜色标识符。 返回值成功时返回TRUE,失败时返回FALSE。 画圆和椭圆要在PHP中绘制圆和椭圆,请使用imageellipse()函数。 我们提供中心点,然后指定椭圆应该有多高和多宽。 imageellipse($myImage,90,60,160,50,$myBlack); 这个椭圆在像素上的中心是(90,60)。椭圆的宽度为160像素,高度为50像素。 要绘制圆形,只需描述具有相同宽度和高度的椭圆形: imageellipse($myImage,70,$myBlack); 实例/* http://www.manongjc.com/article/1753.html 作者:脚本之家教程 */ $image = imagecreatetruecolor(400,300); // Select the background color. $bg = imagecolorallocate($image,0); // Fill the background with the color selected above. imagefill($image,$bg); // Choose a color for the ellipse. $col_ellipse = imagecolorallocate($image,255,255); // Draw the ellipse. imageellipse($image,200,150,300,$col_ellipse); // Output the image. header("Content-type: image/png"); imagepng($image); ?> (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
