I see a lot of sample code where they use CGContextSaveGState and CGContextRestoreGState. Why would I need to save the state of the context?
In order to restore it later.
Some of the things you can change about a context are difficult (e.g., CTM) or impossible (e.g., clipping path) to change back. Saving the gstate lets you undo those changes by restoring the gstate.
The Quartz 2D Programming Guide tells all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With