<?php$src="im.gif";//連接數據庫$info=getimagesize($src);//獲得圖片信息$type=image_type_to_extension($info[2],false);$fun="imagecreateform{$type}";$image=$fun($src);//把圖片復制到內存中$font="msyhbd.ttc";//設置字體路徑$content="你好,哈哈";//加入的內容$col=imagecolorexactalpha($image,255,255,255,50);//用此函數設置字體的顏色和透明度imagefttext($image,20,0,20,30,$col,$font,$content);//把函數寫到圖片中header("Content-type:".$info['mime']);//告訴瀏覽器怎樣輸出$func="image{$type}";//類型$func($image);//輸出?>
- 1 回答
- 0 關注
- 1276 瀏覽
添加回答
舉報
0/150
提交
取消