Version: 1.01

Posted: 2006-09-11

Build Requirements: Xcode 2.3 or greater, Mac OS X 10.4 Universal SDK

Runtime Requirements: Mac OS X 10.4.7 or greater.

View Source Code:

Download Sample (“Quartz2DBasics.zip”, 1.65M)
Download Sample (“Quartz2DBasics.dmg”, 1.93M)



Description

This sample code introduces some of the concepts and features of Quartz. It contains code that:

* fills then strokes a rectangle and strokes then fills a rectangle

* creates a CGPath object and then paints that path with varying degrees of alpha transparency

* draws the contents of a TIFF file using Quartz

* draws the contents of a TIFF file using Quartz clipped by an elliptical shape

* caches content using a CGLayer object and then draws using that cache

* exports any of the above drawing to a PDF file

* exports any of the above drawing as a PNG file

This code sample contains a Carbon and Cocoa project that each have equivalent functionality.

Document Revision History

Date Notes
2006-09-11Now avoids use of floats where unnecessary. Where floating point constants are necessary avoids explicit use (now uses 10.0 instead of 10.0f). These changes make the code more readable while preserving efficiency and make the code ready for conversion to 64 bit.
2006-07-26Carbon and Cocoa sample code demonstrating some basic usage of the Quartz 2D API

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.