Version: 1.1

Posted: 2008-08-14

Build Requirements: Xcode 3.0

Runtime Requirements: Mac OS X 10.5

View Source Code:

Download Sample (“OpenGLScreenSnapshot.zip”, 38.8K)
Download Sample (“OpenGLScreenSnapshot.dmg”, 40.9K)



Description

OpenGLScreenSnapshot is a Mac OS X application which demonstrates how to use OpenGL to grab a "snapshot" of the screen and save it to a image file on disk. This sample uses the OpenGL glReadPixels function to get the pixel data for the screen. This technique is actually very simple to use, and is sufficient for grabbing a single or a very few frames.

Document Revision History

Date Notes
2008-08-14Code refactoring.
2007-06-18Demonstrates how to get the screen pixels using OpenGL and save them to an image file.

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.