Important: The information in this document is obsolete and should not be used for new development.
PicComment
To insert a picture comment into a picture that you are defining or into your printing code, use thePicComment
procedure.
PROCEDURE PicComment (kind,dataSize:\xDDInteger; dataHandle:\xDDHandle);
kind
- The type of comment. Because the vast majority of picture comments are interpreted by printer drivers, the constants that you can supply in this parameter--and values they represent--are listed in Appendix B, "Using Picture Comments for Printing," in this book.
dataSize
- Size of any additional data passed in the
dataHandle
parameter. Data sizes for the various kinds of picture comments are listed in Appendix B, "Using Picture Comments for Printing," in this book. If no additional data is used, specify 0 in this parameter.dataHandle
A handle to additional data, if used. If no additional data is used, specifyNIL
in this parameter.DESCRIPTION
When used after your application begins creating a picture with theOpenCPicture
(orOpenPicture
) function, thePicComment
procedure inserts the specified comment into thePicture
record. When sent to a printer driver after your application uses thePrOpenPage
procedure,PicComment
passes the data or commands in the specified comment directly to the printer.Picture comments contain data or commands for special processing by output devices, such as printers. For example, using the
SetLineWidth
comment, your application can draw hairlines--which are not available with standard QuickDraw calls--on any PostScript LaserWriter printer and on the QuickDraw LaserWriter SC printer.Usually printer drivers process picture comments, but applications can also do so. For your application to process picture comments, it must replace the
StdComment
procedure pointed to by thecommentProc
field of theCQDProcs
orQDProcs
record, which in turn is pointed to by thegrafProcs
field of aCGrafPort
orGrafPort
record. The defaultStdComment
procedure provided by QuickDraw does no comment processing whatsoever. You can use theSetStdCProcs
procedure to assist you in changing theCQDProcs
record, and you can use theSetStdProcs
procedure to assist you in changing theQDProcs
record.If you create and process your own picture comments, you should define comments so that they contain information that identifies your application (to avoid using the same comments as those used by Apple or by other third-party products). You should define a comment as an
ApplicationComment
comment type with akind
value of 100. The first 4 bytes of the data for the comment should specify your application's signature. (See the chapter "Finder Interface" in Inside Macintosh: Macintosh Toolbox Essentials for information about application signatures.) You can use the next 2 bytes to identify the type of comment--that is, to specify akind
value to your own application.Suppose your application signature were
'WAVE'
, and you wanted to use the value 128 to identify akind
value to your own application. You would supply values to thekind
anddata
parameters toPicComment
as follows:
kind
= 100;data
='WAVE'
[4 bytes] + 128 [2 bytes] + additional data [n bytes]Your application can then parse the first 6 bytes of the comment to determine whether and how to process the rest of the data in the comment. It is up to you to publish information about your comments if you wish them to be understood and used by other applications.
SPECIAL CONSIDERATIONS
These former picture comments are now obsolete:SetGrayLevel
,ResourcePS
,PostScriptFile
, andTextIsPostScript
.The
PicComment
procedure may move or purge memory.SEE ALSO
See Appendix B, "Using Picture Comments for Printing," in this book for information about using picture comments to print with features that are unavailable with QuickDraw. See the chapter "QuickDraw Drawing" in this book for information about theQDProcs
record and theStdComment
andSetStdProcs
procedures. See the chapter "Color QuickDraw" in this book for information about theCQDProcs
record and theSetStdCProcs
procedure.