English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP imagearc() function usage and example to draw an elliptical arc

Processamento de Imagens PHP

imagearc — used to draw an elliptical arc.

syntax

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

imagearc() draws an elliptical arc at the center cx, cy (top left corner of the image is 0, 0) in the image represented by image.

w and h specify the width and height of the ellipse, and the starting and ending points are specified by the s and e parameters in degrees. 0° is located at the 3 o'clock position, and is drawn in a clockwise direction.

example

<?php
$img = imagecreatetruecolor(200, 200);// create a 200*200 image
$white  = imagecolorallocate($img,   255,   255, 255); // color
// draw an elliptical arc
imagearc($img, 140,  75,  50,  50,  0, 360, $white);
// browser output image
header("Content-type: image/png");
imagepng($img);
imagedestroy($img);
?>

Processamento de Imagens PHP