-
- //Transparent background image
- header('content-type:text/html;charset=gbk');
- $safess = $_get[safe];
- $dir = dirname(__file__ ).”/simsun.ttc”;
- $safe=iconv(“gb2312″,”utf-8″,$safess);
- $im=imagecreatetruecolor(160,18);
- $color=imagecolorallocate($im,229,231,230 );
- imagecolortransparent($im,$color); // Set to transparent color. If you comment out this line, the background set above will be output.
- imagefill($im,0,0,$color);
- $textcolor=imagecolorallocate( $im,0,0,0);
- imagettftext($im,9,0,30,12,$textcolor,$dir,$safe);
- //imagestring($im,30, 5, 3, $safe , $textcolor);
- header("content-type:image/png");
- imagegif($im);
- ?>
Copy code
|