Important: The information in this document is obsolete and should not be used for new development.
OpenPicture
TheOpenPicturefunction, which was created for earlier versions of system software, is described here for completeness. To create a picture, you should use theOpenCPicturefunction, which allows you to specify resolutions for your pictures, as explained in the previous routine description.
FUNCTION OpenPicture (picFrame:\xDDRect): PicHandle;
picFrame- The bounding rectangle for the picture. The
DrawPictureprocedure uses this rectangle to scale the picture if you draw it into a destination rectangle of a different size.DESCRIPTION
TheOpenPicturefunction returns a handle to a newPicturerecord (described on page 7-26). You can use theOpenPicturefunction to begin defining a picture;OpenPicturecollects 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 ofCopyMask,CopyDeepMask,SeedFill,SeedCFill,CalcMask, andCalcCMask. (Nor can you use thePlotCIconprocedure, described in Inside Macintosh: More Macintosh Toolbox.) You can also use thePicCommentprocedure (described on page 7-39) to include picture comments in your picture definition.The
OpenPicturefunction 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
OpenPicturewhen referring to the picture in subsequent routines, such as theDrawPictureprocedure.The
OpenPicturefunction calls theHidePenprocedure, so no drawing occurs on the screen while the picture is open (unless you call theShowPenprocedure just afterOpenPictureor you calledShowPenpreviously without balancing it by a call toHidePen).After defining the picture, close it by using the
ClosePictureprocedure, described on page 7-41. To draw the picture, use theDrawPictureprocedure, described on page 7-43.SPECIAL CONSIDERATIONS
The version 2 and version 1 picture formats support only 72-dpi resolution. TheOpenCPicturefunction creates pictures in the extended version 2 format. The extended version 2 format, which is created by theOpenCPicturefunction on all Macintosh computers running System 7, permits your application to specify additional resolutions when creating images.See the description of the
OpenCPicturefunction for its list of special considerations, all of which apply toOpenPicture.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.