note 33424 added to function.imagecolorallocate

From: Date: Wed, 25 Jun 2003 16:08:52 +0000
Subject: note 33424 added to function.imagecolorallocate
Groups: php.notes 
Request: Send a blank email to php-notes+get-50997@lists.php.net to get a copy of this message
Remember, first call of imagecolorallocate() always sets the backgroundcolor (!), next calls set e.g. the fontcolor (if used with imagestring()). Simple script for printing an emailaddress as a JPEG, so it's spamproof: <?php $im = imagecreate(95, 15); imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 0, 0, 0); imagestring($im, 2, 0, 0, "user@domain.com", $text_color); imagejpeg($im, "images/email.jpg", 80); // chmod the images dir to 777 print("<img alt=\"Spamproof!\" src=\"/images/email.jpg\" />"); ?> ---- Manual Page -- http://www.php.net/manual/en/function.imagecolorallocate.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33424 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33424&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33424&report=yes

« previous php.notes (#50997) next »