Version: 1.0

Posted: 2007-08-31

Build Requirements: Xcode 3.0

Runtime Requirements: Mac OS X Leopard, QuickTime 7.2.1 or better

View Source Code:

Download Sample (“QTKitMovieFrameImage.zip”, 256.6K)
Download Sample (“QTKitMovieFrameImage.dmg”, 316.7K)



Description

This sample shows how to use the QTMovie frameImageAtTime: method to get an NSImage for the frame at a given time in a QTMovie.

Mac OS X Leopard contains a new version of this method that gives the ability to pass a dictionary of attributes describing exactly the kind of image you want:

- (NSImage *)frameImageAtTime:(QTTime)time withAttributes:(NSDictionary *)attributes error: (NSError **)errorPtr;

Previously, you always got back an NSImage of the current movie size from this method, even if this was not what was desired. This required a lot of post-processing of the returned image.

Now, you can specify the following attributes when calling this method:

QTMovieFrameImageSize

QTMovieFrameImageType

QTMovieFrameImageRepresentationsType

QTMovieFrameImageOpenGLContext

QTMovieFrameImagePixelFormat

QTMovieFrameImageInterlaced

QTMovieFrameImageHighQuality

QTMovieFrameImageSingleField

(See QTMovie.h for more details)

These give the developer much more control over the type of image that is returned.

Document Revision History

Date Notes
2007-08-31Using the QTMovie frameImageAtTime: withAttributes: method to get an image for the frame at a given time in a QTMovie.

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.