PHP/Graphics Image/imagefilledellipse

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

Create a larger image, recreate that brush, and use it as the outline for a shape.

   <source lang="html4strict">

<?php

   $pic = imagecreatetruecolor(600,600);
   $brush = imagecreate(100,100);
   $brushtrans = imagecolorallocate($brush, 0, 0, 0);
   imagecolortransparent($brush, $brushtrans);
   for ($k = 1; $k < 8; ++$k) {
        $color = imagecolorallocate($brush, 255, $k * 15, 0);
        imagefilledellipse($brush, $k * 5, $k * 5, 5, 5, $color);
   }
   imagesetbrush($pic, $brush);
   imageellipse($pic, 300, 300, 350, 350, IMG_COLOR_BRUSHED);
   imagepng($pic);
   imagedestroy($pic);
   imagedestroy($brush);

?>

 </source>
   
  


More Shapes

   <source lang="html4strict">

<?php

   header("content-type: image/png");
   $image = imagecreatetruecolor(400,300);
   $blue = imagecolorallocate($image, 0, 0, 255);
   $green = imagecolorallocate($image, 0, 255, 0);
   $red = imagecolorallocate($image, 255, 0, 0);
   imagefilledellipse($image, 200, 150, 200, 200, $red);
   imagefilledarc($image, 200, 150, 200, 200, 75, 105, $green, IMG_ARC_PIE);
   imagepng($image);
   imagedestroy($image);

?>

 </source>