note 6996 modified in ImageCreate by ronabop
| From: | ronabop@php.net | Date: | Fri, 11 Aug 2000 15:34:10 +0000 |
| Subject: | note 6996 modified in ImageCreate by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1190@lists.php.net to get a copy of this message | ||
Since I needed some time to get something on my screen, here a small example of creating graphics:
<html>
<head>
</head>
<body>
<?php
$pic=ImageCreate(600,600);
$col1=ImageColorAllocate($pic,200,200,200);
$col2=ImageColorAllocate($pic,0,0,255);
ImageFilledRectangle($pic,1,1,100,100,$col2);
ImagePNG($pic,"pic.png");
ImageDestroy($pic);
?>
<img src="pic.png" border=0>
</body>
</html>
--
You create a color for the background ($col1, seems to be zero for the background) and one for the
boxcolor. The image will be written to disk as pic.png and you get it via normal html-command
"img src"... That's it.
Rolf
http://www.php.net/manual/function.imagecreate.php