在文本上添加阴影
我正在寻找使用 PHP 为图像上的文本添加阴影。
我知道如何向图像添加文本以及某些库如何允许您添加块阴影,但我看不到任何允许您添加褪色阴影的库。
这可能吗?
I am looking to add drop shadow to text on an image using PHP.
I am aware on how to add text to images and how some libraries allow you to add block shadowing, but I cannot see any which allow you to add a faded drop shadow.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你想要的是 Imagick::shadowImage ( float $opacity , float $sigma , int $x , int $y )
这是一个例子,我在一些文本上放置阴影,然后将其叠加在背景图像上......
希望这个有帮助,
罗杰
What you want is Imagick::shadowImage ( float $opacity , float $sigma , int $x , int $y )
Here's an example where I put a drop shadow on some text and then superimpose that on a background image...
Hope this helps,
Roger
GD 无法立即做到这一点。如果可以的话,请使用 ImageMagick。有关如何制作形状阴影的示例此处。
GD can't do this out of the box. If you can, use ImageMagick. Examples on how to do shaped shadows here.