imagearc()绘制以给定坐标为中心的圆弧。
语法
PHP imagearc()函数具有以下语法。
bool imagearc(resource $image , int $cx , int $cy , int $width , int $height , int $start , int $end , int $color )
参数
PHP imagearc()函数具有以下参数。
- image - 由图像创建函数(如imagecreatetruecolor())返回的图像资源。
- cx - 中心的x坐标。
- 中心的cy-y坐标。
- width - 弧宽。
- height - 圆弧高度。
- start - 圆弧起始角,以度为单位。
- end - 弧度结束角度,以度为单位。0?位于三点钟位置,并且弧顺时针绘制。
- color - 使用imagecolorallocate()创建的颜色标识符。
返回值
成功时返回TRUE,失败时返回FALSE。
实例
使用imagearc()函数画圆弧。
<?php
/*
http://www.manongjc.com/article/1750.html
作者:码农教程
*/
$img = imagecreatetruecolor(200, 200);// create a 200*200 image
$blue = imagecolorallocate($img, 0, 0, 255);// colors
// draw the head
imagearc($img, 140, 75, 50, 50, 0, 360, $blue);
// output image in the browser
header(\"Content-type: image/png\");
imagepng($img);
imagedestroy($img);
?> 继续阅读与本文标签相同的文章
下一篇 :
到 2022 年,75% 的数据库将托管在云端
-
中国接入互联网25年,这些发展成就值得点赞!
2026-05-15栏目: 教程
-
微信群聊现已上线接龙表格功能
2026-05-15栏目: 教程
-
住客扫码住酒店疑被收集信息?华住回应:不排除个别员工引导
2026-05-15栏目: 教程
-
5G网络即将来临,家里的宽带还有存在的必要吗?听听专家怎么说
2026-05-15栏目: 教程
-
禅城奇槎最快本月底将推出41亩商住地
2026-05-15栏目: 教程
