如何给曲线图片添加文字?

问题描述 投票:5回答:1
$config['source_image'] = '/path/to/image/mypic.jpg';
$config['wm_text'] = 'Copyright 2006 - John Doe';
$config['wm_type'] = 'text';
$config['wm_font_path'] = './system/fonts/texb.ttf';
$config['wm_font_size'] = '16';
$config['wm_font_color'] = 'ffffff';
$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'center';
$config['wm_padding'] = '20';

$this->image_lib->initialize($config);

$this->image_lib->watermark();

这是php中的水印代码,当我们在mugimage这样的曲线图上添加文字时,它工作得很好,但文字并没有与曲线图重合,我们如何克服?

php image gd
1个回答
1
投票

你把这个加到了你的代码里。

$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'center';

所以我想它不会重叠在角落里 除非文字和图片一样长,这样就能到达角落了。也许可以改变padding的大小 wm_padding 使其与曲线边界半径一样宽或更宽?

就像Alix Axel说的那样,请发一些相关的代码,以获得更详细可用的答案。

© www.soinside.com 2019 - 2024. All rights reserved.