第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

求助,瀏覽器中無法顯示圖片,而且未生成圖片

求助,瀏覽器中無法顯示圖片,而且未生成圖片

gudufeng 2016-10-14 15:19:48
文件1 <?php ????class?image{ ????????//?圖片信息變量 ????????private?$image; ????????//?內(nèi)存中的圖片 ????????private?$info; ???????? ????????public?function?_construct($src) ????????{ ????????????$info=getimagesize($src); ????????????$this->info=array( ????????????'width'=>$info[0], ????????????'height'=>$info[1], ????????????'type'=>image_type_to_extension($info[2],false), ????????????'mime'=>$info['mime'] ????????????); ????????????$fun="imagecreatefrom{$this->info['type']}"; ????????????$this->image=$fun($src); ????????} ????????//change ????????public?function?thumb($width,$height) ????????{ ????????????$image_thumb=imagecreatetruecolor($width,$height); ????????????imagecopyresampled($image_thumb,$this->image,0,0,0,0,$width,$height,$this->info['width'],$this->info['height']); ????????????imagedestroy($this->image); ????????????$this->image=$image_thumb; ????????} ????????//display ????????public?function?show() ????????{ ????????ob_clean(); ????????header("Content-type:".$this->$info['mime']); ????????$funs="image{$this->info['type']}"; ????????$funs($this->image); ????????} ????????//save ????????public?function?save($newname) ????????{ ????????????$funs="image{$this->info['type']}"; ????????????$funs($this->image,$newname.'.'.$this->info['type']); ????????} ???????? ????????public?function?_destruct() ????????{ ????????????imagedestroy($this->image); ????????} ????} ?> 文件二 <?php ????require?"image.class.php"; ????$src='001.jpg'; ????$image=new?Image($src); ????$image->thumb(300,150); ????$image->show(); ???? ?>
查看完整描述

1 回答

已采納
?
一瞬兒光

TA貢獻(xiàn)178條經(jīng)驗 獲得超70個贊

三個錯誤。

1,構(gòu)造函數(shù)__construct兩個下劃線;

2,$this->$this->info['mime']; $this后面怎么能跟$呢?

3,save方法都沒有調(diào)用怎么執(zhí)行?

查看完整回答
1 反對 回復(fù) 2016-10-14
  • 1 回答
  • 0 關(guān)注
  • 1723 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號