note 68873 deleted from function.imagegif by danbrown

From: Date: Tue, 09 Jun 2009 13:16:23 +0000
Subject: note 68873 deleted from function.imagegif by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156597@lists.php.net to get a copy of this message
Note Submitter: rokfaith at gmail dot com ---- I've recieved e-mails on this, so i will elaborate (original post ~2 posts down): the RenderFrame($frame) function should be a function that returns an image resource and does something sensibe with the integer (frame number) that it gets passed. function RenderFrame($frame) { $im = imagecreatetruecolor(100,100); //or just imagecreate for smaller images imageantialias($im, true); //works only on true color images, slower //draw something on image (imageline, imagerect, imageftt...) return $im; } this way the image is drawn and destroyed every iteration of the loop, so you can animate moving things, eg. text. if you keep the image between function calls, you get the effect of progressively drawing the image: change $im = imagecreatetruecolor(100,100); into static $im = imagecreatetruecolor(100,100);

« previous php.notes (#156597) next »