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 /
Appendix A - Picture Opcodes


Version and Header Opcodes

In a picture created in extended version 2 or version 2 format, the first opcode is the 2-byte VersionOp opcode: $0011. This is followed by the 2-byte Version opcode: $02FF. With system software version 4.1 or later, the Version opcode identifies the picture as an extended version 2 or a version 2 picture, and all subsequent opcodes are read as words (which are word-aligned within the picture). In versions of system software that precede version 4.1, the $02 is read as the version number, then the $FF is read and interpreted as the end-of-picture opcode--for this reason, DrawPicture on a pre-4.1 system terminates without drawing any part of an extended version 2 or version 2 picture.

The 2-byte HeaderOp opcode ($0C00) follows the Version opcode in an extended version 2 or version 2 format picture. The next 24 bytes contain header information. The value of the 2-byte version opcode that follows the HeaderOp opcode indicates whether the picture is an extended version 2 picture or a version 2 picture: the Version opcode has a value of -2 for an extended version 2 picture and a value of -1 for a version 2 picture. The rest of the header for an extended version 2 picture contains resolution information; the rest of the header for a version 2 picture specifies a fixed-point bounding box.

Opcodes that perform drawing commands follow the header information. The OpEndPic opcode ($00FF) signals the end of the picture for an extended version 2 picture or a version 2 picture.

For an example of the version and header opcodes in a decompiled extended version 2 picture, see Listing A-5 on page A-23. For an example of the version and header opcodes in a decompiled version 2 picture, see Listing A-6 on page A-24.

In a version 1 picture, the VersionOp opcode has a value of $11, which is followed by a value of $01. For a version 1 picture, QuickDraw parses the remaining drawing opcodes 1 byte at a time; there is no header information in a version 1 picture. An end-of-picture byte ($FF) after the last opcode or data byte in the file signals the end of the picture.

For an example of the version opcodes in a disassembled version 1 picture, see
Listing A-7 on page A-25.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996