Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CGPath masked off CGPoints

I'm trying to build this: enter image description here

Where the white background is in fact transparent. I know how to clip a CGPath to a set region, but this seems to be to other way around, since I need to substract regions from a filled CGPath.

I guess the right way to go would be to substract the whole outer-circles from the CGPath and then to draw smaller circles at my CGPoints, but I'm not sure how to execute the former. Can anyone point me in the right direction?

like image 941
samvermette Avatar asked Feb 25 '23 01:02

samvermette


1 Answers

That's what I would do :

1) Draw your general line

2) CGContextSetBlendMode(context, kCGBlendModeClear) to "clear the context" when you draw.

3) Draw you bigger circles

4) CGContextSetBlendMode(context, kCGBlendModeNormal) to return to normal drawing

5) Draw your little circles.

like image 135
gcamp Avatar answered Mar 06 '23 18:03

gcamp