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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么不顯示圖片啊

<?php

class Image {

private $image;

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);

}

/*操作圖片(壓縮)*/

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;

}

/*添加文字水印*/

public function fontMark($content,$font_url,$size,$color,$local,$angle){

$col = imagecolorallocatealpha($this->image,$color[0],$color[1],$color[2],$color[3]);

imagettftext($this->image,$size,$angle,$local['x'],$local['y'],$col,$font_url,$content);

}

/*在瀏覽器中輸出圖片*/

public function show(){

header("Content-type:".$this->info['mime']);

$funs = "image{$this->info['type']}";

$funs($this->image);

}

/*把圖片保存在硬盤中*/

public function save($newname){

$funs = "image{$this->info['type']}";

$funs($this->image,$newname.'.'.$this->info['type']);

}

/*銷毀內(nèi)存中的圖片*/

public function __destruct(){

imagedestroy($this->image);

}

}

?>

***************************test.php*********************************


<?php

require "image.class.php";

$src = "img/first.jpg";

$content = "你好啊";

$font_url = "img/msyh.ttc";

$size = 20;

$color = array(

0=>255,

1=>255,

2=>255,

3=>50

);?

$local = array(

'x'=>20,

'y'=>30

);

$angle = 10;

$image = new Image($src);

$image->fontMark($content,$font_url,$size,$color,$local,$angle);

$image->show();

?>

正在回答

1 回答

仔細(xì)檢查下圖片的路徑對(duì)不對(duì)

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Abreto 提問者

非常感謝!
2016-09-05 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么不顯示圖片啊

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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