Draw ellipse in PHP

Description

The following code shows how to draw ellipse.

Example


<html>//from   w w  w .j a  v  a  2s .co  m
<body>
<?php
   $img=ImageCreate(300,300);
   $bgcolor=ImageColorAllocate($img,200,200,200);
   $red=ImagecolorAllocate($img,255,0,0); 
                                                            
   Imageellipse($img,50,50,100,50,$red);
                              
   ImagePNG($img,"pic.png");
   ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>

The code above generates the following result.

Draw ellipse in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text