Jump To:
Leopard Technical Q&As: 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 Technical Q&As.
Document Descriptions
On Off

Sort by
Sorted by
Driving OpenGL Rendering Loops (HTML)
QA1385: Using Core Video display links (CVDisplayLink) or Cocoa timers (NSTimer) to drive an OpenGL rendering loop
Core Animation properties and Reference Counting (HTML)
QA1565: Describes a discrepancy between the property declarations in Core Animation and the actual behavior.
Animating the frame of a CALayer. (HTML)
QA1620: Explains how the frame property of a layer interacts with animations.
Getting the pixel data from a CGImage object (HTML)
QA1509: Describes how to access the pixel data of a CGImage object
Requirements for Quartz GL (HTML)
QA1536: Describes the requirements for enabling Quartz GL.
How do I get the hexadecimal value of an NSColor object? (HTML)
QA1576: Describes how to convert an NSColor object to its Hexadecimal value.
How to measure CG text (HTML)
QA1051: Explains how to measure Core Graphics text.
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Using UTIs to Identify Image Files (HTML)
QA1518: Explains how to use Uniform Type Identifiers to identify what files can be opened at images.
Debugging Graphics with QuartzDebug (HTML) (日本語 HTML)
QA1236: Explains how to use QuartzDebug to debug graphics issues.
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.
Finding an NSView's current magnification. (HTML)
QA1346: How to discover the current magnification (zoom level) of any NSView.
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.
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
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.
Setting the ColorSync profile for a NSBitmapImageRep object (HTML)
QA1369: Setting the ColorSync profile for a NSBitmapImageRep object
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.
CGImageRef contents are immutable (HTML) (日本語 HTML)
QA1276: Explains that CGImageRef contents are considered immutable once created.
Is ColorSync thread safe? (HTML) (日本語 HTML)
QA1261: Discusses ColorSync thread-safety issues.
Quartz 2D Thread Safety (HTML) (日本語 HTML)
QA1238: Explains the thread-safety issues for the Quartz 2D API.
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.
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.
Quartz 2D Interpolation (HTML) (日本語 HTML)
QA1186: Explains how to control Quartz 2D's image interpolation.
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
CGContext Bounds (HTML)
QA1048: Explains how to determine the bounds of a CGContext.
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.