所用到的wordToImg.php文件代码:
$ment = $_GET['word'];
$im = p_w_picpathcreate(450,50);
$white = p_w_picpathcolorallocate($im,56,180,218); //调整合适,达到消除锯齿效果
p_w_picpathcolortransparent($im,$white);
$black = p_w_picpathcolorallocate($im,255, 255,255);
p_w_picpathttftext($im,26,0,0,40,$black,“C:\windows\Fonts\FZDHTJW.ttf”,$ment); //字体路径
header(“Content-type:p_w_picpath/png”);
p_w_picpathpng($im);
?>
mail.php代码
/*
MailX Managment System 0.8 Beta
*/
header("Content-type:p_w_picpath/png");
$mailaddress=$_GET['mailname'];
$mailaddresslen=strlen($mailaddress);
$mailaddressp_w_picpaths=p_w_picpathcreate($mailaddresslen*10,25);
$lenadd=$mailaddresslen;
$fontsize="4";
$center=(p_w_picpathsx($mailaddressp_w_picpaths)-8.3*strlen($mailaddress))/2;
$mailp_w_picpathsbackground=ImageColorAllocate($mailaddressp_w_picpaths,255,255,255);
$mailp_w_picpathsfacecolor=ImageColorAllocate($mailaddressp_w_picpaths,0,0,0);
ImageString($mailaddressp_w_picpaths,$fontsize,$center,5,$mailaddress,$mailp_w_picpathsfacecolor);
Imagepng($mailaddressp_w_picpaths);
ImageDestroy($mailaddressp_w_picpaths);
?>
255,255,255 生成图片的背景颜色(RGB哦)
$fontsize="4";字体大小
( $mailaddresslen*10,25); $mailaddresslen*10表示:生成图片宽:Email地址字符个数*10,25表示高
以上代码保存为mail.php 然后访问mail.php?mailname=you@domain.com,就可以输出mailname=后面的邮件地址了.