[comp.sys.mac] PICT files

campoly@violet.berkeley.edu (Mr. Science) (10/13/87)

I am working on an graphics application and wish to be able to read PICT files
(or PICT resources from the clipboard) created by other programs.  I have
the relevant TechNotes (#21 on QuickDraw internal format and #27 on
MacDraw PICT file format).  However, TechNote #21 states that the 
information is for "DEBUGGING PURPOSES ONLY."  The reason being that
a program will not be able to handle "new objects" if they are added at
some future time.

My question is how else can one decipher the information in a PICT file?
Just calling DrawPicture with a handle to the picture will draw the 
picture on the screen, but this doesn't help me in extracting the kind and
location of the individual graphics objects.  If a several rectangles,
ovals, and line segments are in the picture, I want to know the appropriate
screen coordinates of each object.  All this info is in the PICT file,
but it does depend on knowing, for example, that hex code 30 is a
rectangle, with the next 8 bytes giving the coordinates of the corners
of that rectangle.  Should I just ignore the caveat in the TechNote and
parse the PICT file or is there some other clever way of extracting the
information?  (Anyone know if Apple has, in fact, added new objects?)

In keeping with recent requests, please e-mail responses to me and I
will summarize them in a later posting.

Thanks in advance.

  Gregory Dow			ARPA:   campoly@violet.berkeley.edu
  Chemical Engineering Dept.	UUCP:   {uwvax, decvax, ihnp4, ...}!ucbvax
  University of California	          !campoly%violet.berkeley.edu
  Berkeley, CA  94720		BITNET: POLYDOW@UCBCMSA