• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

浏览器无法显示图片

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']);   }   //销毁图片   public function __destruct()   {       imagedestroy($this->image);   }                }

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

全部参与1

数组引用加引号,我测试过的
imagettftext($this->image,$size,$angle,$local['x'],$local['y'],$col,$font_url,$content);

使用道具 举报

发新帖

发布任务需求已有1031168位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!