Important: The information in this document is obsolete and should not be used for new development.
Picture
When you use theOpenCPictureorOpenPicturefunction (described on page 7-36 and page 7-38, respectively), QuickDraw begins collecting your subsequent drawing commands in aPicturerecord. (You use theClosePictureprocedure, described on page 7-41, to complete a picture definition.) When you use theGetPicturefunction (described on page 7-45) to retrieve a picture stored in a resource,GetPicturereads the resource into memory as aPicturerecord. ('PICT'resources are described on page 7-66.) By using theDrawPictureprocedure (described on page 7-43), you can draw onscreen the picture defined by the commands stored in thePicturerecord.A
Picturerecord is defined as follows:
TYPE Picture = RECORD picSize: Integer; {for a version 1 picture: its size} picFrame: Rect; {bounding rectangle for the picture} {variable amount of picture data in the form of opcodes} END;Picture comments and compact drawing instructions in the form of picture opcodes compose the rest of this record.
Field Description
picSize- The size of the rest of this record for a version 1 picture. To maintain compatibility with the version 1 picture format, the
picSizefield was not changed for the version 2 picture or extended version 2 formats. The information in this field is useful only for version 1 pictures, which cannot exceed 32 KB in size. Because version 2 and extended version 2 pictures can be much larger than the 32 KB limit imposed by the 2-bytepicSizefield, you should use the Memory Manager functionGetHandleSizeto determine the size of a picture in memory, the File Manager functionPBGetFInfoto determine the size of a picture in a'PICT'file, and the Resource Manager functionMaxSizeResourceto determine the size of a'PICT'resource. (See Inside Macintosh: Memory, Inside Macintosh: Files, and Inside Macintosh: More Macintosh Toolbox for more information about these functions.)picFrame- The bounding rectangle for the picture defined in the rest of this record. The
DrawPictureprocedure uses this rectangle to scale the picture if you draw it into a destination rectangle of a different size.A picture opcode is a number that the
DrawPictureprocedure uses to determine what object to draw or what mode to change for subsequent drawing. For debugging purposes, picture opcodes are listed in Appendix A at the back of this book. Your application generally should not read or write this picture data directly. Instead,
your application should use theOpenCPicture(orOpenPicture),ClosePicture, andDrawPictureroutines to process these opcodes.The
Picturerecord can also contain picture comments. Created by applications using thePicCommentprocedure, picture comments contain data or commands for special processing by output devices, such as PostScript printers. ThePicCommentprocedure is described on page 7-39, and picture comments are described in greater detail in Appendix B in this book.You can use File Manager routines to save the picture in a file of type
'PICT', you can use Resource Manager routines to save the picture in a resource of type'PICT', and you can use the Scrap Manager procedurePutScrapto store the picture in'PICT'scrap format. See the chapter "File Manager" in Inside Macintosh: Files and the chapters "Resource Manager" and "Scrap Manager" in Inside Macintosh: More Macintosh Toolbox for more information about saving files, resources, and scrap data.