[comp.sys.mac.programmer] Regions in PICT resources?

thomas@uvabick.UUCP (Thomas Fruin) (08/31/88)

Anyone come across this one?

I suppose it _is_ logical once you start thinking about it ... but MacDraw
does NOT understand the complete PICT format!  I mean, it knows how to handle
all those fancy PICT Comments, but it IGNORES regions!?~r

OK, you can take two views in this matter:   

1) Tech Note 27 (MacDraw PICT file format - you'll need the old version,
   the new version is obsolete, phone Claris) says MacDraw will read PICT 
   files.  These files consist of a 512 byte header which you can zero,
   followed by a PICT definition.  This definition is described in Tech
   Note 21 (QuickDraw's internal picture definition), and includes (of course)
   the Region.  So ... MacDraw should accept Regions.  It doesn't however.
   
   Recommended solution: update the Tech Notes to reflect this.

2) MacDraw is an object-oriented editor (sorry for the confusing usage of
   the word object-oriented, but it _is_ suitable) for graphics, that will 
   let you edit lines, polygons, ovals, arcs, and text.  As far as I can
   tell, it has _no_ provision for editing something called a region.  What's
   a region anyway?!

   Recommended solution: shrug shoulders, but don't spend an afternoon
   trying to get MacDraw (or SuperPaint or MacPaint etc.) to display
   the regions in the PICT file your application created.  Usually you can 
   manage things with polygons anyway.

Any other (more knowledgable?) views?

-- Thomas Fruin
 
   fruin@hlerul5.BITNET                     University of Leiden
   thomas@uvabick.UUCP                      University of Amsterdam
   hol0066.AppleLink
   2:512/114.FidoNet (MacSaga MotherBoard)  The Netherlands

clay@claris.UUCP (Clay Maeckel) (09/01/88)

In article <381@uvabick.UUCP> thomas@uvabick.UUCP (Thomas Fruin) writes:
>I suppose it _is_ logical once you start thinking about it ... but MacDraw
>does NOT understand the complete PICT format!  I mean, it knows how to handle
>all those fancy PICT Comments, but it IGNORES regions!?

[Time to get my foot inserted]

There are a couple of reasons why regions have not been supported in MacDraw.

1.  Regions are ignored by the QuickDraw to PostScript print drivers. (See
TechNote #72)

2.  MacDraw wasn't designed as a PICT editor, it inserts many of its own
PICT comments and strips out comments that it does not know about.

3.  Apple doesn't publish the region's internal format and reserves the right
to change it at anytime.  This is importart because when MacDraw reads in a
PICT, it converts each object into its own internal data structures.  I am not
sure of anyway to decompose a region back into it's orginal QuickDraw calls.

There are some technical ways around these problems, such as converting regions
into bitmaps (poor printing on high resolutions devices, lose information when
converting back to regions) or trying to generate polygons from the region
(depends on the regions internal data structure).

It would be nice if someone would develop a PICT editor and it would even be
better if it was put into ResEdit.  But this product would only be of
interest to developers, students, and hobbiest.  Sounds like something
Apple's development tools group should do.


-- 
 Clay Maeckel         *   UUCP: {ames,apple,portal,sun,voder}!claris!clay
 (I know nothing!)    *   Arpanet: claris!clay@ames.arc.nasa.gov
 Claris Corporation   *   AppleLink: Maeckel1   *   CompuServe: 73057,255

fry@husc8.HARVARD.EDU (David Fry) (09/02/88)

When MacDraw saves a smoothed filled polygon, it includes the
interior as a filled region.  This, I think, is a clue that
regions in MacDraw should be treated as Polygons with the
appropriate PicComments to handle the spline.  Then MacDraw
will treat it as we would normally think of a region.  This is
enforced by the knowledge that the LaserWriter drivers will
not work with regions.

To confuse the issue, however, Apple now says its LaserWriter
drivers no longer handle polygon PicComments either, which I
find distressing.  I don't know what their work around is.
They (tech support, that is) say this is being looked at right
now.

David Fry				fry@huma1.harvard.EDU
Department of Mathematics		fry@harvma1.bitnet
Harvard University			...!harvard!huma1!fry
Cambridge, MA  02138