我使用CGBlendModClear来绘制位于背景视图顶部的平滑视图。
let rep = viewToCapture.bitmapImageRepForCachingDisplayInRect(viewToCapture.bounds)!
viewToCapture.cacheDisplayInRect(viewToCapture.bounds, toBitmapImageRep: rep)
let img = LmImage(size: viewToCapture.bounds.size)
img.addRepresentation(rep)
橡皮擦的区域是黑色
答案 0 :(得分:0)
橡皮擦路径代码
CGContextSetLineCap(context, CGLineCap.Round)
CGContextSetBlendMode(context, .Clear)
CGContextSetLineWidth(context, self.strokeWeight)
CGContextStrokePath(context)
compositeView的快照 enter image description here
我想要的结果是 enter image description here