Can't capture masks within view layer

前端 未结 1 1856
清歌不尽
清歌不尽 2021-01-23 07:45

So I\'m applying an image mask to a UIView layer with the following code:

CALayer *maskLayer = [CALayer layer];
UIImage *maskImage = self.image.image;
maskLayer.         


        
相关标签:
1条回答
  • 2021-01-23 08:34

    It's unfortunate, but that's just how it works. The documentation for -[CALayer renderInContext:] says:

    ... layers that use 3D transforms are not rendered, nor are layers that specify backgroundFilters, filters, compositingFilter, or a mask values.

    CoreAnimation is intended for on-screen, animated drawing; it isn't a general-purpose graphics framework. Try using CoreGraphics instead -- it isn't that difficult, you'll have more control, and you'll get higher-quality output.

    0 讨论(0)
提交回复
热议问题