标签:
<?php $filename="des_big.jpg"; $fileInfo=getimagesize($filename); //echo $fileInfo; echo "<br>"; $mime=$fileInfo[‘mime‘]; //echo $mime; echo "<br>"; $createFun=str_replace("/","createfrom",$mime); //echo $createFun; echo "<br>"; $outFun=str_replace("/",null,$mime); $image=$createFun($filename); //echo $image; echo "<br>"; $color=imagecolorallocatealpha($image,255,0,0,50); $fontfile="../fonts/h.ttf"; $text="imooc.com"; imagettftext($image,14,0,0,14,$color,$fontfile,$text); //header("content-type:".$mime); $outFun($image,$filename); imagedestroy($image); echo "<img src=‘$filename‘>"; ?>
标签:
原文地址:http://www.cnblogs.com/jacson/p/4255223.html