最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

瀏覽器無法顯示圖片

瀏覽器無法顯示圖片

PHP
慕粉4279450 2017-05-22 13:43:49
class?Image{ ???//內(nèi)存中的圖片 ???private?$image; ??//圖片的基本信息 ???private?$info; ???//打開一張圖片,讀取到內(nèi)存中 ???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;//用壓縮圖片代替內(nèi)存中原圖像 ???} ???//操作圖片(添加文字水印) ????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']); ???} ???//銷毀圖片 ???public?function?__destruct() ???{ ???????imagedestroy($this->image); ???} ???????????? ????} ???? ????<?php? ????require?"image.class.php"; ????$src='timg.jpg'; ????$content="歡迎來到南充農(nóng)商網(wǎng)"; ????$font_url="simsun.ttc"; ????$size=20; ??????$color=array( ?????????0?=>?255, ?????????1?=>?255, ?????????2?=>?255, ?????????3?=>?20 ?????); ?????$local=array( ????????'x'=>20, ????????'y'=>30 ??????); ????$angle=10; ????$image=new?Image($src); ????$image->fontMark($content,$font_url,$size,$color,$local,$angle); ????$image->show(); ?>
查看完整描述

1 回答

?
orangewangjie3473319

TA貢獻(xiàn)5條經(jīng)驗(yàn) 獲得超2個(gè)贊

數(shù)組引用加引號(hào),我測試過的
imagettftext($this->image,$size,$angle,$local['x'],$local['y'],$col,$font_url,$content);

查看完整回答
2 反對(duì) 回復(fù) 2017-05-27
  • 1 回答
  • 0 關(guān)注
  • 1277 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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