问答详情
源自:5-3 封装成类—添加图片水印

不报错 老师给看看代码有问题吗?

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

}

<?php

require 'class_thumb.php';

$src = '1.jpg';

$content = "hello word!";

$font_url= 'msyh.ttf';

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

?>


提问者:金哆啦A梦 2016-06-07 00:16

个回答

  • 太阳神_SunOracle
    2016-06-14 12:47:57

    呼叫老师!