如何向弯曲图像添加文本?
$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中的水印代码,当我们向马克杯等曲线图像添加文本时,它工作正常 图像中,字母不重叠,弯曲图像如何克服?
$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();
This is water mark code in php, it is working fine when we add text to curve image like mug
image, the letter is not overlap the curved image how can we overcome?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将其添加到代码中:
所以我想它不会与角重叠,除非文本与图像本身一样长/宽,以便它到达角。也许更改填充
wm_padding
,使其与曲线/边框半径一样宽或更宽?正如 Alix Axel 所说,请发布一些相关代码以获得更详细/可用的答案。
You added this to your code:
So I guess it won't overlap the corners, unless the text is as long/wide as the image itself, so that it reaches the corners. Maybe change the padding
wm_padding
so that it's as wide or wider than the curve/border radius?And like Alix Axel said, please post some relevant code for more detailed/usable answers.