Chapter 12. Drawing Offscreen
There are many reasons your application might need to draw into an offscreen graphics environment. Perhaps the most common is to create a cache containing a complex drawing. Using the cache, the complex drawing can be drawn to the screen quickly many times over. With a rasterization-based drawing library like Quartz 2D, another popular reason is to create a pixel-based representation of a drawing.
Quartz 2D includes several techniques for drawing offscreen:
You can create a graphics metafile using the PDF file format.
An application can create an offscreen pixel map and a bitmap graphics context to draw on it.
You can use a Quartz object known as a CGLayer to cache drawings offscreen.
The discussion of creating Quartz ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access