CGContext: how do I erase pixels (e.g. kCGBlendModeClear) outside of a bitmap context?

前端 未结 3 1766
梦毁少年i
梦毁少年i 2021-02-01 09:29

I\'m trying to build an eraser tool using Core Graphics, and I\'m finding it incredibly difficult to make a performant eraser - it all comes down to:

CGContextSetB

3条回答
  •  不思量自难忘°
    2021-02-01 10:12

    key is CGContextBeginTransparencyLayer and use clearColor and set CGContextSetBlendMode(context, kCGBlendModeClear);

提交回复
热议问题