Important: The information in this document is obsolete and should not be used for new development.
Picture
When you use theOpenCPicture
orOpenPicture
function (described on page 7-36 and page 7-38, respectively), QuickDraw begins collecting your subsequent drawing commands in aPicture
record. (You use theClosePicture
procedure, described on page 7-41, to complete a picture definition.) When you use theGetPicture
function (described on page 7-45) to retrieve a picture stored in a resource,GetPicture
reads the resource into memory as aPicture
record. ('PICT'
resources are described on page 7-66.) By using theDrawPicture
procedure (described on page 7-43), you can draw onscreen the picture defined by the commands stored in thePicture
record.A
Picture
record 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
picSize
field 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-bytepicSize
field, you should use the Memory Manager functionGetHandleSize
to determine the size of a picture in memory, the File Manager functionPBGetFInfo
to determine the size of a picture in a'PICT'
file, and the Resource Manager functionMaxSizeResource
to 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
DrawPicture
procedure 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
DrawPicture
procedure 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
, andDrawPicture
routines to process these opcodes.The
Picture
record can also contain picture comments. Created by applications using thePicComment
procedure, picture comments contain data or commands for special processing by output devices, such as PostScript printers. ThePicComment
procedure 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 procedurePutScrap
to 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.