Draw a Circle with imagearc() in PHP

Description

The following code shows how to draw a Circle with imagearc().

Example


<?php//from w  ww .  jav a 2s.co  m
header("Content-type: image/png");
$image = imagecreate( 200, 200 );
$red = imagecolorallocate($image, 255,0,0);
$blue = imagecolorallocate($image, 0,0,255 );
imagearc( $image, 99, 99, 180, 180, 0, 360, $blue );
imagefill( $image, 99, 99, $blue );
imagepng($image);
?>

The code above generates the following result.

Draw a Circle with imagearc() in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text