Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
QTGraphicsImport
Last Revision: | Version 1.0, 2003-01-14 Demonstrates how to use the QuickTime Graphics Importer to draw an image into a NSWindow using a NSQuickDrawView. |
Build Requirements: | |
Runtime Requirements: | Mac OS X |
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.
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14