如何在PHP的GD库中为文本添加辉光或阴影? [英] How can I add glow or a shadow to text in PHP's GD library?

查看:129
本文介绍了如何在PHP的GD库中为文本添加辉光或阴影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在GD中为文本添加辉光或阴影?目前,我正在使用imagettftext函数.

Is it possible to add glow or a shadow to text in GD? Currently I am using the imagettftext function.

推荐答案

我遇到了这个问题,并创建了一个名为imagettftextblur的新函数,该函数已作为开源发布在

I ran into this problem and created a new function called imagettftextblur which I've released as open source at https://github.com/andrewgjohnson/imagettftextblur

以下是添加阴影的方法:

Here is how to add a shadow:

imagettftextblur($image,$size,0,$x + 3,$y + 3,$shadow_color,$font,$string,1); // 1 can be higher to increase blurriness of the shadow
imagettftextblur($image,$size,0,$x,$y,$text_color,$font,$string);

这篇关于如何在PHP的GD库中为文本添加辉光或阴影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆