PHP - 使用图像生成透明度(或不透明度)渐变
使用 PHP 是否可以获取现有图像并生成原始图像从 100% 不透明变为 0% 不透明(或 0% 透明变为 100% 透明!)的副本?
谢谢,
托比
编辑:我意识到我的问题不清楚,抱歉。我想拍摄一张图像并在其上创建不透明度渐变,因此图像顶部 100% 不透明,底部 100% 透明,中间半透明。
Using PHP is it possible to take an existing image and produce a copy where the original image changes from 100% opaque to 0% opaque (or 0% transparent to 100% transparent!)?
Thanks,
Toby
EDIT: I realise my question was unclear, apologies. I want to take an image and create an opacity gradient across it, so the image is 100% opaque at the top, 100% transparent at the bottom and translucent in between.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果从 100% 不透明更改为 0% 不透明,图像将不再可见。你到底想做什么?更改整个图像还是仅更改一部分?我会考虑使用 CSS(也许 + javascript),您可以将透明度设置在 0% 到 100% 之间。
If you change from 100% opaque to 0% opaque the image wouldn't be visible anymore. What do you want to do exactly? Change The whole Image or only a part? I would consider of using CSS (maybe + javascript) where you are able to set the transparency between 0% and 100%.
好吧,如果你将图像从 100% 调到 0%,它就会消失,对吗? 0%到100%意味着它是透明的所以它变黑了?我不确定您到底在问什么,请尝试本教程
Well if you take an image from 100% to 0%, it disappears right ? and 0% to 100% means it was transparent so it went black? I'm not sure exactly what you are asking bu try this tutorial