Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 7 - Pictures / Pictures Reference
QuickDraw and Picture Utilities Routines / Creating and Disposing of Pictures


The OpenPicture function, which was created for earlier versions of system software, is described here for completeness. To create a picture, you should use the OpenCPicture function, which allows you to specify resolutions for your pictures, as explained in the previous routine description.

FUNCTION OpenPicture (picFrame:\xDDRect): PicHandle;
The bounding rectangle for the picture. The DrawPicture procedure uses this rectangle to scale the picture if you draw it into a destination rectangle of a different size.
The OpenPicture function returns a handle to a new Picture record (described on page 7-26). You can use the OpenPicture function to begin defining a picture; OpenPicture collects your subsequent drawing commands in this record. When defining a picture, you can use all other QuickDraw drawing routines described in this book, with the exception of CopyMask, CopyDeepMask, SeedFill, SeedCFill, CalcMask, and CalcCMask. (Nor can you use the PlotCIcon procedure, described in Inside Macintosh: More Macintosh Toolbox.) You can also use the PicComment procedure (described on page 7-39) to include picture comments in your picture definition.

The OpenPicture function creates pictures in the version 2 format on computers with Color QuickDraw when the current graphics port is a color graphics port. Pictures created in this format support color drawing operations at 72 dpi. On computers supporting only basic QuickDraw, or when the current graphics port is a basic graphics port, this function creates pictures in version 1 format. Pictures created in version 1 format support only black-and-white drawing operations at 72 dpi.

Use the handle returned by OpenPicture when referring to the picture in subsequent routines, such as the DrawPicture procedure.

The OpenPicture function calls the HidePen procedure, so no drawing occurs on the screen while the picture is open (unless you call the ShowPen procedure just after OpenPicture or you called ShowPen previously without balancing it by a call to HidePen).

After defining the picture, close it by using the ClosePicture procedure, described on page 7-41. To draw the picture, use the DrawPicture procedure, described on page 7-43.

The version 2 and version 1 picture formats support only 72-dpi resolution. The OpenCPicture function creates pictures in the extended version 2 format. The extended version 2 format, which is created by the OpenCPicture function on all Macintosh computers running System 7, permits your application to specify additional resolutions when creating images.

See the description of the OpenCPicture function for its list of special considerations, all of which apply to OpenPicture.

Version 1 pictures are limited to 32 KB. You can determine the picture size while it's being formed by calling the Memory Manager function GetHandleSize.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996