PHP/Graphics Image/imagepng

Материал из Web эксперт
Версия от 10:05, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Include color information

   <source lang="html4strict">

<?php

   $image = imagecreate(400,300);
   $gold = imagecolorallocate($image, 255, 240, 00);
   imagepng($image);
   imagedestroy($image);

?>

 </source>
   
  


Working with PNGs

   <source lang="html4strict">

<?php

   $animage = imagecreate (200, 200);
   $red = imagecolorallocate ($animage, 255, 0, 0);
   imagerectangle ($animage, 0, 0, 200, 200, $red);
   $black = imagecolorallocate ($animage, 0, 0, 0);
   imagefilledellipse($animage, 100, 100, 150, 150, $black);
   $white = imagecolorallocate ($animage, 255, 255, 255);
   imagestring($animage, 5, 48, 95, "Hello World!", $white);
   imagepng ($animage);
   header ("Content-type: image/png");
   imagedestroy ($animage);

?>

 </source>