Version: 1.0

Posted: 2003-01-14

Build Requirements: N/A

Runtime Requirements: Mac OS X

View Source Code:

Download Sample (“QTGraphicsImport.zip”, 47.0K)
Download Sample (“QTGraphicsImport.dmg”, 92.7K)



Description

This sample demonstrates how to use the QuickTime graphics importer to draw/manipulate an image in a Cocoa NSWindow using the NSQuickDrawView class. The NSQuickDrawView class provides a single method, -qdport, which gives us a QuickDraw graphics port for use within the NSWindow/NSView. We pass the graphics port returned by this method to QuickTime (specifically, the GraphicsImportSetGWorld function) to specify our drawing environment. Additionally, we override the drawRect method in the NSView/NSQuickDrawView class to perform all our drawing using the Graphics importer routines. The sample will initially draw the image "qtlogo.pct" contained in the application package. However, the user can set a new image by pressing the "Set Image" button. Also, the user may export the image to a different format by pressing the "Export" button.

Document Revision History

Date Notes
2003-01-14Demonstrates how to use the QuickTime Graphics Importer to draw an image into a NSWindow using a NSQuickDrawView.

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.