Create Image on the fly
| From: | Jan Grafström | Date: | Thu, 17 Jan 2002 11:18:36 +0000 |
| Subject: | Create Image on the fly | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-80899@lists.php.net to get a copy of this message | ||
Hi!
How do I change this if I will use the Image direct in my html-code?
Do I need to save it first.
<?php
$im = @ImageCreate (240, 80)
or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 255, 255, 230);
$text_color = ImageColorAllocate ($im, 0, 0, 0);
ImageString ($im, 3, 10, 20, "Some text..", $text_color);
ImagePng ($im);
//this doesn´t work
echo "<img src=\"$im\" width=240 height=80>";
?>
Thanks in advance.
--
Regards
Jan Grafström
Lillemans Hus AB
Bredsäter 2091
87010 Älandsbro
0611-60920
070-6409073