Figured I would put my 2 cents in, since I actually just did something similar to this for my portfolio. I grabbed my function for a basic string to image, and made some minor changes and comments
PHP Code:
<?php
/*
* Create a Image Base.
* Sizes are in pixels(px), though you do not need to include this.
* $var = imagecreate(width, height);
*/
$image = imagecreate(200, 25);
/*
* Set Image Background Color.
* 0=darkest - 255=lightest
* imagecolorallocate(source, red, blue, green);
*/
imagecolorallocate($image, 200, 200, 200);
/*
* create string color
* imagecolorallocate(source, red, blue, green);
*/
$fontColor = imagecolorallocate($image, 0, 0, 0);
/*
* Set x-coordinate of the upper left corner of the string
*/
$startX = 35; //35 px from left
/*
* Set y-coordinate of the upper left corner of the string
*/
$startY = 5; //5 px from top
/*
* Set the string to be used. This is set via GET calls.
* ex: image.php?string=YourName@Host.com
* Or can be changed here.
*/
$string = $_GET['string'];
/*
* Draw a textual string onto your source.
* imagestring(source, font-size, X-coord, Y-coord, string, font-color);
*/
imagestring($image, 3, $startX, $startY, $string, $fontColor);
/*
* Set document type.
* This will be the type of image displayed.
* Most common image types:
* header("Content-type: image/jpeg");
* header("Content-type: image/gif");
* header("Content-type: image/png");
*/
header("Content-type: image/jpeg");
/*
* Output your new image.
* Depending on header type:
* imagejpeg($source);
* imagepng($source);
* imagegif($source);
*/
imagejpeg($image);
/*
* free memory associated with your image.
*/
imagedestroy($image);
?>
call that like image.php?string=YourName@Host.com in your browser, or in an image tag as your src.
Do some expiramenting with it. Change image sizes, colors, types, etc...
though like Wildhoney said... Its not good to publicly display email addresses. Site crawling bots that harvest emails, and spam them with porn ads... its not fun. The above script could, should, and did have many more security features added to it.
Oh, Where i have my imagestring(), is where you would use the imagefttext($image, $textvar) if you really wanted to. see
http://us2.php.net/imagefttext for more details.