Thursday, May 31, 2012

Creating a circle image in PHP using Graphics


<?php 

// create a 200*200 image 
$img = imagecreate(200, 200); 
  
// allocate some colors 
$white = imagecolorallocate($img, 255, 255, 255); 
  
// draw a white circle 
imagearc($img, 100, 100, 150, 150, 0, 360, $white); 

// output image in the browser 
header("Content-type: image/png"); 
imagepng($img); 
  
// free memory 
imagedestroy($img); 

?>

No comments:

Post a Comment