在 Android 中将位图转换为棕褐色
有什么方法可以将位图转换为棕褐色吗? 我知道转换为灰度就是在ColorMatrix中设置setSaturation。 但是棕褐色呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有什么方法可以将位图转换为棕褐色吗? 我知道转换为灰度就是在ColorMatrix中设置setSaturation。 但是棕褐色呢?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
如果您有图像实例,则可以使用 ColorMartix 以棕褐色绘制它。让我描述一下如何使用 Drawable 来做到这一点。
示例项目已从 Bitbucket 移至 GitHub。请检查发布部分下载APK二进制文件进行测试,无需编译。
If you have instance of image then you can use ColorMartix to draw it in Sepia. Let me describe way how you can do this using Drawable.
Sample project was moved from Bitbucket to GitHub. Please check Release section to download APK binary to test without compiling.
我知道答案,但也许如果有人有其他更好的解决方案..
I know the answer, but maybe if some have other better solution..
我改进了OP的答案。与
ColorMatrix
方法< /a>,但会产生更好的棕色色调。 (在我看来)I've improved on the OP's answer. This runs competitively fast when compared to the
ColorMatrix
method, but producing a nicer brown tone. (in my opinion)