Jump To:
Leopard Reference Library: Cocoa
Cocoa provides classes for custom drawing based on Quartz graphics, and utility functions for common graphics tasks such as copying and drawing bitmap data. To go beyond what Cocoa provides, developers can use the graphics and imaging frameworks in Mac OS X. Cocoa applications have access to a wide variety of graphics technologies including Quartz 2D, Quartz Services, OpenGL, QuickTime, and the Mac OS X printing system.

View all Graphics & Imaging Reference Library.
Document Descriptions
On Off
Display

Sort by
Title
Sort by
Resource Type
Sorted by
Date
CarbonCocoaCoreImageTab (HTML) (DMG) (ZIP)
Carbon-based application creates a Cocoa-based web window which used CoreImage filters to transition between tabbed WebViews
Sample Code 2006-07-25
GLSLShowpiece (HTML) (DMG) (ZIP)
GLSLShowpiece demonstrates several Vertex and Fragment shaders
Sample Code 2006-07-17
Printing Programming Topics for Cocoa (HTML) (PDF)
Explains how to support printing in Cocoa applications.
Guides 2006-06-28
Scroll View Programming Guide for Cocoa (HTML) (PDF)
Describes how to use scroll views in Cocoa applications.
Guides 2006-06-28
Animation Programming Guide for Cocoa (HTML) (PDF)
Describes how to use Cocoa animation objects to enhance user interface transitions.
Guides 2006-05-23
CIColor Additions Reference (HTML) (PDF)
Describes additions to support Cocoa color information.
Reference 2006-05-23
NSClipView Class Objective-C Reference (HTML) (PDF)
Describes the class that contains and scrolls the document view of a scroll view.
Reference 2006-05-23
NSScrollView Class Reference (HTML) (PDF)
Describes a view for displaying content larger than its bounds.
Reference 2006-05-23
NSViewAnimation Class Reference (HTML) (PDF)
Describes an animation in a view or window.
Reference 2006-05-23
PDFAnnotationCircle Class Reference (HTML) (PDF)
Describes the class for manipulating circle annotations in PDF documents.
Reference 2006-05-23
PDFAnnotationInk Class Reference (HTML) (PDF)
Describes the class for manipulating ink annotations in PDF documents.
Reference 2006-05-23
PDFAnnotationLink Class Reference (HTML) (PDF)
Describes the class for manipulating link annotations in PDF documents.
Reference 2006-05-23
PDFAnnotationMarkup Class Reference (HTML) (PDF)
Describes the class for manipulating markup annotations (highlighting, underlining, and so on) in PDF documents.
Reference 2006-05-23
PDFAnnotationSquare Class Reference (HTML) (PDF)
Describes the class for manipulating square annotations in PDF documents.
Reference 2006-05-23
PDFBorder Class Reference (HTML) (PDF)
Describes the class for creating and manipulating borders around annotations in PDF documents.
Reference 2006-05-23
DragItemAround (HTML) (DMG) (ZIP)
Illustrates creating a custom subclass of NSView.
Sample Code 2006-03-16
Making the most of Cocoa bindings in Quartz Composer (HTML)
TN2146: Describes how to best use Cocoa bindings with Quartz Composer.
Technical Notes 2006-03-03
Taking Advantage of PDF Kit in Your Cocoa Application (HTML)
Learn to handle PDF documents in your Cocoa application without writing a lot of custom code.
Articles 2006-02-20
Working with Quartz Composer (HTML)
Learn to build a sample composition without having to write code.
Articles 2006-02-13
Debugging Graphics with QuartzDebug (HTML) (日本語 HTML)
QA1236: Explains how to use QuartzDebug to debug graphics issues.
Technical Q&As 2006-01-12
Getting images in and out from Quartz Composer compositions (HTML)
TN2143: Describes how to efficiently pass images into and out of Quartz Composer
Technical Notes 2005-10-04
PDFKitLinker2 (HTML) (DMG) (ZIP)
Demonstrates many aspects of PDFKit including navigation, display modes, searching, and PDFView subclassing.
Sample Code 2005-08-10
CIAnnotation (HTML) (DMG) (ZIP)
Image annotation application using Core Image Filters. Demonstrates creation and usage of Image Units.
Sample Code 2005-08-01
VideoViewer (HTML) (DMG) (ZIP)
Simple example of video rendering using QuickTime visual contexts, OpenGL, Core Video and Core Image.
Sample Code 2005-08-01
QTCoreImage101 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using Core Image filters and the new video pipeline.
Sample Code 2005-07-19
Color Management Overview (HTML) (PDF)
Introduces basic concepts and defines color spaces.
Guides 2005-07-07
Quartz Composer QCTV (HTML) (DMG) (ZIP)
Shows how to build a fake TV system using Quartz Composer as the foundation motion graphics.
Sample Code 2005-07-06
Reducer (HTML) (DMG) (ZIP)
Simple utility for rescaling bitmapped images. Demonstrates use of Core Image, NSAnimation, view drawing redirection.
Sample Code 2005-06-06
UnsharpMask (HTML) (DMG) (ZIP)
Demonstrates how to build Automator actions using Cocoa frameworks.
Sample Code 2005-06-06
How can I optimize a Quartz Composer composition depending on the hardware it runs on? (HTML)
QA1433: Explains how to design compositions that adapt to the hardware limitations.
Technical Q&As 2005-06-01
Link Snoop (HTML) (DMG) (ZIP)
Shows how to use PDFKit to scan for and highlight link annotations in PDFs.
Sample Code 2005-06-01
Quartz Composer Live DV (HTML) (DMG) (ZIP)
Shows how to export a Quartz Composer composition as a real-time DV stream on the FireWire port.
Sample Code 2005-06-01
Quartz Composer Matrix (HTML) (DMG) (ZIP)
Shows how to use Quartz Composer to display a QuickTime movie as a series of frames in a 3D world.
Sample Code 2005-06-01
Quartz Composer Offline Rendering (HTML) (DMG) (ZIP)
Shows how to render a Quartz Composer composition as a series of images using an OpenGL pBuffer.
Sample Code 2005-06-01
Quartz Composer Texture (HTML) (DMG) (ZIP)
Shows how to use a Quartz Composer composition as an OpenGL texture.
Sample Code 2005-06-01
Quartz Composer WWDC 2005 Composition (HTML) (DMG) (ZIP)
Shows how to build a parameterized motion graphics composition with Quartz Composer.
Sample Code 2005-06-01
Quartz Composer WWDC 2005 TextEdit (HTML) (DMG) (ZIP)
Demonstrate how to modify TextEdit's about dialog to display a Quartz Composer composition.
Sample Code 2005-06-01
QuartzLines (HTML) (DMG) (ZIP)
Drawing Lines using Quartz's CGPath & CGContextStrokeLineSegments functions.
Sample Code 2005-06-01
TexturePerformanceDemo (HTML) (DMG) (ZIP)
OpenGL texture optimization demo for WWDC Session 214
Sample Code 2005-06-01
VertexPerformanceDemo (HTML) (DMG) (ZIP)
Vertex optimization demo for WWDC Session 214
Sample Code 2005-06-01
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Sample Code 2005-06-01
Resolution Independent UI Release Notes (HTML)
Release Notes 2005-04-29
Tiger Developer Overview Series: Developing with Core Image (HTML)
Learn how Core Image can help you take your graphics development to the next level.
Articles 2005-03-09
Finding an NSView's current magnification. (HTML)
QA1346: How to discover the current magnification (zoom level) of any NSView.
Technical Q&As 2005-03-08
OpenGL Release Highlights - Mac OS X 10.3 Panther (HTML)
TN2131: Contains a list of bugs along with a short description on a release-by-release basis
Technical Notes 2005-02-04
NSOpenGLView redraw problems after a window is closed and re-opened. (HTML)
QA1353: Workaround for NSOpenGLView failure to draw after its window is closed and re-opened.
Technical Q&As 2004-12-03
NSGLImage (HTML) (DMG) (ZIP)
Deprecated - Demonstrates how to texture in OpenGL with an NSImage and/or NSBitmapImageRep
Sample Code 2004-12-01
Using Interface Builder's NSOpenGLView or Custom View objects for an OpenGL application (HTML)
QA1167: Describes usage cases for both NSOpenGLViews and Custom Views for Cocoa OpenGL applications
Technical Q&As 2004-10-28
How do I determine how much VRAM is available on my video card? (HTML)
QA1168: Using Core Graphics and IOKit to find the physical size of VRAM on installed hardware.
Technical Q&As 2004-10-11
Setting the ColorSync profile for a NSBitmapImageRep object (HTML)
QA1369: Setting the ColorSync profile for a NSBitmapImageRep object
Technical Q&As 2004-09-08
Video Hardware Info (HTML) (DMG) (ZIP)
Sample demonstrates how to query the video hardware for useful information.
Sample Code 2004-02-12
NSOpenGL Fullscreen (HTML) (DMG) (ZIP)
Demonstrates how to create and switch between windowed and fullscreen OpenGL contexts using NSOpenGL.
Sample Code 2004-02-11
Shearing a Coordinate Space with NSAffineTransform (HTML) (日本語 HTML)
QA1332: Describes a simple way to shear coordinate spaces by adding a few methods to the NSAffineTransform class.
Technical Q&As 2004-01-29
Understanding and Detecting OpenGL Functionality (HTML)
TN2080: Discusses OpenGL API design, and how to access the full power of hardware and software renderers.
Technical Notes 2003-12-29
ColorMatching (HTML) (DMG) (ZIP)
Performs simple color matching of images using ColorSync or the QuickTime 6.4 Graphics Importers.
Sample Code 2003-12-18
OpenGL Screensaver (HTML) (DMG) (ZIP)
Demonstrates how to integrate OpenGL drawing into a standard Cocoa screen saver on Mac OS X.
Sample Code 2003-12-10
RGB ValueTransformers (HTML) (DMG) (ZIP)
Supersedes the "RGB Image sample". Sample now uses bindings. Color separation now done in an NSValueTransformer subclass.
Sample Code 2003-11-18
FancyAbout (HTML) (DMG) (ZIP)
Demonstrates several visual effects for "About..." panels such as scrolling text, window without a title bar, and ways to dismiss the window.
Sample Code 2003-10-27
CGImageRef contents are immutable (HTML) (日本語 HTML)
QA1276: Explains that CGImageRef contents are considered immutable once created.
Technical Q&As 2003-07-17
Cocoa CG aliasing demo (HTML) (DMG) (ZIP)
Shows how to draw both aliased and anti-aliased text and graphics using Quartz and Cocoa.
Sample Code 2003-07-17
Cocoa CG arc demo (HTML) (DMG) (ZIP)
Shows how to draw both aliased and anti-aliased arcs using Quartz and Cocoa.
Sample Code 2003-07-17
Monochrome Image (HTML) (DMG) (ZIP)
Applies the NTSC color weighting formula to an image to generate a monochrome version of the image.
Sample Code 2003-07-16
VBL (HTML) (DMG) (ZIP)
A simple example of how to create an OpenGLView in AppKit.
Sample Code 2003-07-07
FunkyOverlayWindow (HTML) (DMG) (ZIP)
Demonstrates several window layering, transparency and widget interaction techniques in Cocoa.
Sample Code 2003-05-08
CubePuzzle (HTML) (DMG) (ZIP)
Models a Rubik's Cube using Cocoa and OpenGL
Sample Code 2003-04-21
GLChildWindowDemo (HTML) (DMG) (ZIP)
Shows using Cocoa's child windows and Quartz Extreme to provide 2D/3D overlays above 3D content.
Sample Code 2003-04-21
OpenGLCompositorLab (HTML) (DMG) (ZIP)
Demonstrates using OpenGL to composite multiple sources in hardware. Requires NVIDIA GeForce 4 Ti hardware.
Sample Code 2003-04-21
Is ColorSync thread safe? (HTML) (日本語 HTML)
QA1261: Discusses ColorSync thread-safety issues.
Technical Q&As 2003-04-17
Quartz 2D Thread Safety (HTML) (日本語 HTML)
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Technical Q&As 2003-02-25
Image Difference (HTML) (DMG) (ZIP)
Demonstrates a way to use Quartz's compositing capability to find the difference between two images.
Sample Code 2003-01-30
PDFView (HTML) (DMG) (ZIP)
Shows how to display or print a multi-page PDF document and scroll an NSscrollview's contents by dragging.
Sample Code 2003-01-23
CGDrawPicture (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the QDPictDrawToCGContext API.
Sample Code 2003-01-14
Color Sampler (HTML) (DMG) (ZIP)
Demonstrates one way to sample the color at a given point in an NSView.
Sample Code 2003-01-14
ColorBars (HTML) (DMG) (ZIP)
Shows how to enumerate, select, capture, manipulate, draw to, and release displays using the CGDirectDisplay API.
Sample Code 2003-01-14
ColorSyncDevices-Cocoa (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Manager routines in the Cocoa environment.
Sample Code 2003-01-14
Cropped Image (HTML) (DMG) (ZIP)
Demonstrates how to extract a sub-image from another image, and some ways of indicating a selection.
Sample Code 2003-01-14
CTMClip (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing with clipping.
Sample Code 2003-01-14
CTMDemo (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing without clipping.
Sample Code 2003-01-14
Polygons (HTML) (DMG) (ZIP)
Demonstrates the NSBezierPath class, as well as the manipulation of NSView's coordinate space for convenience.
Sample Code 2003-01-14
QTtoCG (HTML) (DMG) (ZIP)
Shows how to create a CGImageRef with the proper ColorSync profile from a QuickTime image on disk.
Sample Code 2003-01-14
Quartz EB (HTML) (DMG) (ZIP)
WWDC 2001 Early Bird Quartz 2D tutorial of vector drawing and PDF import/export.
Sample Code 2003-01-14
RGB Image (HTML) (DMG) (ZIP)
Demonstrates compositing to separate an NSimage into its RGB components, and how to recombine those components.
Sample Code 2003-01-14
RoundTransparentWindow (HTML) (DMG) (ZIP)
Creating (in Cocoa) custom-shaped windows and transparent window content; plus changing the shape of windows dynamically.
Sample Code 2003-01-14
SimpleCocoaJavaMovieCocoa (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the NSMovieView and NSMovie Cocoa Java AppKit classes.
Sample Code 2003-01-14
SonOfSillyBalls (HTML) (DMG) (ZIP)
Draws a bunch of randomly colored, randomly placed, silly balls in a window on the screen.
Sample Code 2003-01-14
Tinted Image (HTML) (DMG) (ZIP)
Demonstrates the use of an NSImage as an off-screen drawing destination.
Sample Code 2003-01-14
Transformed Image (HTML) (DMG) (ZIP)
Shows the effects of a rendering an NSImage in a transformed coordinate space.
Sample Code 2003-01-14
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) (日本語 HTML)
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Technical Q&As 2002-12-04
How can I programmatically determine the DPI of the current video mode? (HTML) (日本語 HTML)
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Technical Q&As 2002-12-02
Image Views (HTML) (PDF)
Explains how to use Cocoa image views.
Guides 2002-11-12
Quartz 2D Interpolation (HTML) (日本語 HTML)
QA1186: Explains how to control Quartz 2D's image interpolation.
Technical Q&As 2002-10-29
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Technical Q&As 2001-10-02
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
Technical Q&As 2001-10-02
CGContext Bounds (HTML)
QA1048: Explains how to determine the bounds of a CGContext.
Technical Q&As 2001-07-02
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Technical Q&As 2001-07-02
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Technical Q&As 2001-07-02
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Technical Q&As 2001-07-02
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.
Technical Q&As 2001-07-02