PHP/Graphics Image/Ellipse

Материал из Web эксперт
Перейти к: навигация, поиск

Draw ellipse

<html>
<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>



Draw Filled Ellipse

<?php
$myImage = ImageCreateFromPNG ("logo.png");
$c = ImageColorAllocate ($myImage, 2, 255, 255);
ImageFilledEllipse($myImage, 10, 7, 20, 20, $c);
ImageFilledEllipse($myImage, 15, 7, 20, 20, $c);
ImageFilledEllipse($myImage, 20, 7, 20, 20, $c);
header ("Content-type: image/png");
ImagePNG($myImage);
ImageDestroy($myImage);
?>



Filled ellipse

<html>
<body>
<?php
   $img=ImageCreate(300,300);
   $bgcolor=ImageColorAllocate($img,200,200,200);
   $red=ImagecolorAllocate($img,255,0,0); 
                                                            
   Imagefilledellipse($img,50,150,50,50,$red);
                              
   ImagePNG($img,"pic.png");
   ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>