导航首页 » 技术教程 » PHP:imagearc()的用法_GD库图像处理函数
PHP:imagearc()的用法_GD库图像处理函数 151 2023-12-15   

imagearc

(PHP 4, PHP 5)

imagearc — 画椭圆弧

说明

bool imagearc ( resource $image , int $cx , int $cy , int $w , int $h , int $s , int $e , int $color )

imagearc()cxcy(图像左上角为 0, 0)为中心在 image 所代表的图像中画一个椭圆弧。wh 分别指定了椭圆的宽度和高度,起始和结束点以 se 参数以角度指定。0°位于三点钟位置,以顺时针方向绘画。

Example #1 用 imagearc() 画一个圆

<?php
// 创建一个 200X200 的图像
$img = imagecreatetruecolor(200, 200);
// 分配颜色
$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 0, 0);
// 画一个黑色的圆
imagearc($img, 100, 100, 150, 150, 0, 360, $black);
// 将图像输出到浏览器
header("Content-type: image/png");
imagepng($img);
// 释放内存
imagedestroy($img);
?>

参见 imageellipse(),imagefilledellipse() 和 imagefilledarc()。


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103