Important: The information in this document is obsolete and should not be used for new development.
Chapter 7 - Pictures
This chapter describes QuickDraw pictures, which are sequences of saved drawing commands. Pictures provide a common medium for the sharing of image data. Pictures make it easier for your application to draw complex images defined in other applications; pictures also make it easier for other applications to display images created with your application. Virtually all applications should support the creation and drawing of pictures. All applications that support cut and paste, for example, should be able to draw pictures copied by the user from the Clipboard.Read this chapter to learn how to record QuickDraw drawing commands into a picture and how to draw the picture later by playing back these commands. You should also read this chapter to learn about the Picture Utilities, which allow your application to gather information about pictures--such as their colors, fonts, picture comments, and resolution. You can also use the Picture Utilities to gather information about the colors in pixel maps. Your application can use this information in conjunction with the Palette Manager, for example, to provide the best selection of colors for displaying a picture or other pixel image on an indexed device.
The
OpenCPicture
function, available on all Macintosh computers running System 7, allows your application to create pictures in the extended version 2 picture format. This format allows your application to specify resolutions when creating pictures.Pictures can be created in color or black and white. Computers supporting only basic QuickDraw use black and white to display pictures created in color.
As described in this chapter, your application can use File Manager or Resource Manager routines to save or open pictures stored in files. See the chapter "File Manager" in Inside Macintosh: Files for more information about the File Manager; see the chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox for more information about the Resource Manager. To store or retrieve pictures in the scrap--for example, when the user copies from or pastes to the Clipboard--you must use Scrap Manager routines. See the chapter "Scrap Manager" in Inside Macintosh: More Macintosh Toolbox for more information about the Scrap Manager.
You typically use the information gathered with the Picture Utilities in conjunction with other system software managers. You might use the Picture Utilities to determine what fonts are used in a picture, for example, and then use Font Manager routines to help you determine whether those fonts are available on the user's system. Or, you might use the Picture Utilities to determine the most-used colors in a picture, and then use the Palette Manager or ColorSync Utilities to provide sophisticated support for these colors. For more information about fonts, see the chapter "Font Manager" in Inside Macintosh: Text. The Palette Manager and the ColorSync Utilities are described in Advanced Color Imaging on the Mac OS.
You can also save and collect picture comments within your picture, as described in this chapter. Typically, however, your application uses picture comments to include special drawing commands for printers. Therefore, picture comments are described in greater detail in Appendix B, "Using Picture Comments for Printing," in this book.
Chapter Contents
- About Pictures
- Picture Formats
- Opcodes: Drawing Commands and Picture Comments
- Color Pictures in Basic Graphics Ports
- 'PICT' Files, 'PICT' Resources, and the 'PICT' Scrap Format
- The Picture Utilities
- Using Pictures
- Creating and Drawing Pictures
- Opening and Drawing Pictures
- Drawing a Picture Stored in a 'PICT' File
- Drawing a Picture Stored in the Scrap
- Defining a Destination Rectangle
- Drawing a Picture Stored in a 'PICT' Resource
- Saving Pictures
- Gathering Picture Information
- Pictures Reference
- Data Structures
- QuickDraw and Picture Utilities Routines
- Creating and Disposing of Pictures
- Drawing Pictures
- Collecting Picture Information
- Application-Defined Routines
- Resources
- The Picture Resource
- The Color-Picking Method Resource
- Summary of Pictures and the Picture Utilities
- Pascal Summary
- Constants
- Data Types
- Routines
- Application-Defined Routines
- C Summary
- Constants
- Data Types
- Functions
- Application-Defined Functions
- Assembly-Language Summary
- Data Structures
- Trap Macros
- Result Codes