這是我的關于創建簡單圖像的代碼可是運行結果如圖所示,求大神賜教!
2 回答

哥特式KK
TA貢獻7條經驗 獲得超0個贊
你應該設置header,才能保證它正確顯示,如:
$im?=?imagecreate(200,?60); imagecolorallocate($im,?225,?66,?159); if?(function_exists("imagegif"))?{ ????header("Content-type:?image/gif"); ????imagegif($im); }?elseif?(function_exists("imagejpeg"))?{ ????header("Content-type:?image/jpeg"); ????imagejpeg($im,?"",?0.5); }?elseif?(function_exists("imagepng"))?{ ????header("Content-type:?image/png"); ????imagepng($im); }?elseif?(function_exists("imagewbmp"))?{ ????header("Content-type:?image/vnd.wap.wbmp"); ????imagewbmp($im); }?else?{ ????die("No?image?support?in?this?PHP?server"); }
- 2 回答
- 0 關注
- 1730 瀏覽
添加回答
舉報
0/150
提交
取消