note 33424 deleted from function.imagecolorallocate by didou
| From: | didou@php.net | Date: | Fri, 15 Aug 2003 21:09:56 +0000 |
| Subject: | note 33424 deleted from function.imagecolorallocate by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54243@lists.php.net to get a copy of this message | ||
Note Submitter: matthijs@rohs.nl
----
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\" />");
?>