有錯誤出現求解答
/*圖片壓縮*/
public function thumbImage($width,$height){
? ?$image_thumb=imagecreatetruecolor($width,$height);
? ?imagecopyresampled($image_thumb,$this->image,0,0,0,0,$width,$height,$this->imageinfo['width'],$this->imageinfo['height']);
? ?imagedestroy($this->image);
? ?$this->image=$image_thumb;
}
/*添加文字水印*/
public function fontMark($content,$font_url,$font_size,$color,$local,$angle){
? ?$colortrue=imagecolorallocatealpha($this->image,$color[0],$color[1].$color[2],$color[3]);
? ?imagettftext($this->image,$font_size,$angle,$local['x'],$local['y'],$colortrue,$font_url,$content);
}
/*瀏覽器中顯示圖片*/
public function showImage(){
? ?header("Content-type:",$this->imageinfo['mime']);
? ?self::printImage($this->image);
}
/*保存實體文件*/
public function saveImage($picName){
? ?$picturename=$picName.'.'.$this->imageinfo['type'];
? ?self::printImage($this->image,$picturename);
}
2017-02-21
$content='hello world'后面應該是分號;
2017-02-21
那塊是截得屏幕里的圖片,講到那塊自己錯了,后面視屏里改回來了,我出現的主要錯誤是
$colortrue=imagecolorallocatealpha($this->image,$color[0],$color[1].$color[2],$color[3]);
這一行的$color[1].$color[2]之間用點連接了,導致參數少了一個報錯,不過還是謝謝你了
2017-02-21
逗號都不對,都是分號才行。