[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [MacPerl] Graphics and MacPerl



}Pardon me if this has been asked before, but is there any
}kind of a library routine which allows MacPerl to do
}graphics on the Mac?  I've scanned through the library
}routines and do not see one (or more likely I missed it
}when I zipped through the things).  MacPerl is what I'd
}like to use to do some really minor graphical stuff which I
}could probably do in Chipmunk Basic, but I'd rather stick
}with one language.  TIA!  :-)

Graphics like line plots or graphics like simple pictures?  If the latter,
there's GD, which is included in MacPerl.  I've never used it, but it seems
to have enough power to at least do simple images.  The output is in GIF,
which makes it portable.

------------------------------------------------------------------------------------------
If you are trying to generate graphics through a Perl script, I
would suggest designing a Perl Postscript generator.  This is
something that I have done at the pipeline company I work for where
it is often necessary to generate line schematics graphically depicting
information about the pipeline system. I use MacPerl to generate the base
schematic in postscript, query a database (really a collection of text files) for
the needed information, and then draw the information onto the schematic
complete with a legend. The resultant file can then be sent to a PS printer
using dropPS, GhostScript, or any other tool of that kind. If you have
Acrobat Distiller, you can even convert the PS file to a PDF file for
on-screen viewing.

I found PostScript a fairly easy language to get started with, especially if
you are only doing simple stuff.  I would personally recommend getting
Postscript by Example by McGilton and Campione published by Addison-
      Wesley as an easy-to-learn introductory text.

      Louis

---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us