如何将 UIColor 应用到现有图像?

发布于 2024-09-27 16:49:43 字数 91 浏览 0 评论 0原文

我有 a1.png 图像。 我想对该图像应用颜色效果。 我所说的“应用颜色”是指 alpha < 的前景色。 1. 有人有解决办法吗?

I have a1.png image.
I want to apply a color effect on that image.
By "apply a colour" I mean a foreground color with alpha < 1.
Does anyone have a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情感失落者 2024-10-04 16:49:43

我认为您正在寻找 GLImageProcessing 示例代码

I think you are looking for GLImageProcessing sample code

一指流沙 2024-10-04 16:49:43

我还没有找到将 UIColor 应用于现有图像的解决方案。

一种替代方法是,您可以获取视图并将颜色应用于视图,而不是对图像应用颜色。

UIColor *color = [del color];

[perceptView setBackgroundColor:[color colorWithAlphaComponent:0.5]];

[perceptView setNeedsDisplay];

I haven't get solution for applying UIColor to existing image.

One alternative way is that instead of applying color to an image you can take a View and apply color to the view.

UIColor *color = [del color];

[perceptView setBackgroundColor:[color colorWithAlphaComponent:0.5]];

[perceptView setNeedsDisplay];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文