Re: Create Image on the fly

From: Date: Thu, 17 Jan 2002 12:18:33 +0000
Subject: Re: Create Image on the fly
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-80903@lists.php.net to get a copy of this message
Thanks Val! Now I understand. Jan "Val Petruchek" <petruchek@zsu.zp.ua> skrev i meddelandet news:000801c19f4a$49862950$6e64010a@weblab.zsu.zp.ua... > > in index.html you write > <img src=aaa.php> > > > in aaa.php you write > > <?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); > ?> > > You have to create separate php script for creating image and then use it in > you html (php) file. > > > > > 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. > > > > Valentin Petruchek (aki Zliy Pes) > http://zliypes.com.ua > mailto:val@zliypes.com.ua > >

« previous php.general (#80903) next »