imagearc 画椭圆弧 php函数


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(200200);
// 分配颜色
$white imagecolorallocate($img255255255);
$black imagecolorallocate($img000);
// 画一个黑色的圆
imagearc($img1001001501500360$black);
// 将图像输出到浏览器
header("Content-type: image/png");
imagepng($img);
// 释放内存
imagedestroy($img);
?>

参见 imageellipse()imagefilledellipse()imagefilledarc()


« 
» 
快速导航

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