Latest web development tutorials

PHP imagearc - Videos elliptical arcs

PHP Image Processing PHP Image Processing

imagearc - used to draw elliptical arcs.

grammar

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

imagearc () to cx, cy (top left is 0, 0) as the center of the image represented in the drawing an elliptical arc.

w and h specifies the ellipse's width and height, the start and end points s and e parameter to specify the angle. 0 ° located at the three o'clock position, clockwise painting.

Examples

<?php
$img = imagecreatetruecolor(200, 200);// 创建一个 200*200 图片
$white  = imagecolorallocate($img,   255,   255, 255); // 颜色

// 画椭圆弧
imagearc($img, 140,  75,  50,  50,  0, 360, $white);

// 浏览器输出图片
header("Content-type: image/png");
imagepng($img);

imagedestroy($img);
?>

The above example of the output picture is as follows:

PHP Image Processing PHP Image Processing