通过另一个图像遮罩图像
好吧,我想做的是:
- 给定一个图像,该图像内有一个“空白”的圆圈。我想从用户库中获取现有图像,然后对其进行屏蔽,以便仅该图像的特定部分显示在“空白”图像上。
我尝试了一些屏蔽代码,但它们似乎都以相反的方式工作...关于如何解决这个问题有什么建议吗?
Alright what I am trying to do is:
- given an image where there is a circle within that image that is "blank". I want to take an existing image from user library and then mask it so that only a certain part of that image is shown on the "blank" image..
I have tried a few masking code but they all seem to work the other way around ... any tips on how to tackle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是你不能使用CoreAnimation来做到这一点(这会让它变得相当容易)。
查看 Apple 的 CoreAnimation 文档:
因此,下一个最佳方法是使用 Quartz 2D (如回答此处):
Unfortunately you can't use CoreAnimation to do this (which would make it rather easy).
Looking at Apple's CoreAnimation documentation:
Therefore the next best way to do this is to use Quartz 2D (as answered here):