I want to crop the picture on my CGContext
, but I need it just the opposite, that is, I want to add some rectangles to my clipping path using CGContextAddRect()
, and clipping should be done so that all the rectangles that I added to my clipping path, not affected by any drawing operations. As a rule, this is just the opposite, i.e. The drawing functions draw rectangles that have been added to the clipping path and leave areas that have not been added to the clipping path unaffected. Therefore, I assume that I only need a way to change the clipping path before calling CGContextClip()
. In QuickDraw days, this can be easily done using regions, and then calling XorRgn()
for each rectangle. But with quartz it looks more complicated. Does anyone have a simple solution to achieve this, or do I need to do all these reverse path calculations myself?
source share