Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

CGLayer Drawing

CGLayer objects (CGLayerRef data type), available in Mac OS X v. 10.4 and later, allow your application to use layers for drawing. CGLayer objects are suited for the following:


Figure 12-1  Repeatedly painting the same butterfly image

Repeatedly painting the same butterfly image

CGLayer objects and transparency layers are parallel to CGPath objects and paths created by CGContext functions. In the case of a CGLayer and a CGPath object, you paint to an abstract destination and can then later draw the complete painting to another destination, such as a display or a PDF. When you paint to a transparency layer or use the CGContext functions that draw paths, you draw directly to the destination represented by a graphics context. There is no intermediate, abstract destination for assembling the painting.

This chapter:

Contents:

How CGLayer Drawing Works
Drawing With a CGLayer
Example: Using Multiple CGLayer objects to Draw a Flag




< Previous PageNext Page > Hide TOC


Last updated: 2007-12-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice