为 PNGCanvas 图像添加透明度
我一直在玩PNGCanvas,但有一件事我不明白是如何为图像添加透明度。我一直在尝试改变 Alpha 通道值,但它只能调整颜色的强度。我是否使用这个库找错了树,或者还有希望吗?
I've been playing around with PNGCanvas, and the one thing I can't figure out is how to add transparency to images. I've been trying to vary the alpha channel values, but it only adjusts the intensity of the color. Am I barking up the wrong tree using this library, or is there hope?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你找错了树。以下是
PNGCanvas.dump
的引用:进一步查看其代码,当您提供 alpha 时,它只是将其与背景混合,最终的背景只是白色。
You're barking up the wrong tree. Here's a quote from
PNGCanvas.dump
:Looking further through its code, when you provide alpha it's just blending it with the background, and the final background is just white.