Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!wuarchive!sdd.hp.com!uakari.primate.wisc.edu!uflorida!mailer.cc.fsu.edu!sun13!gw.scri.fsu.edu!pepke From: pepke@gw.scri.fsu.edu (Eric Pepke) Newsgroups: comp.sys.mac.programmer Subject: Re: How can I convert a PICT file to a PICT resource ? Message-ID: <1075@sun13.scri.fsu.edu> Date: 10 Oct 90 15:34:56 GMT Sender: news@sun13.scri.fsu.edu Distribution: usa Organization: Florida State University, but I don't speak for them Lines: 25 References:<1990Oct9.192518.7593@cerc.utexas.edu> <11294@claris.com> <17049@unix.SRI.COM> Good ways of doing it with existing programs have already been suggested, but if you are interested in the guts of how it works, a PICT file consists of 512 bytes of whatever followed by a PICT. So, to read a PICT file in and convert it into a PICT resource, 1) Determine the size of the file 2) Make a handle that size minus 512 bytes 3) Skip over the first 512 bytes of the file 4) Stuff the remainder into the handle 5) Save the handle as a PICT resource When I want to use PICTures in applications from whatever source, I use a different approach: 1) Copy the graphics I want to the clipboard 2) Paste it into ResEdit 3) Rename and renumber the resulting PICT resource to whatever I want Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.