[comp.sys.mac.programmer] How can I convert a PICT file to a PICT resource ?

min@cerc.utexas.edu (Hyoung Bok Min) (10/10/90)

    I can draw and save a picture in a PICT format with MacDraw II. I wan to use
this picture in my application. To use this, I think it should be converted to
a PICT resource. How can I do this conversion (from PICT file in data fork to a
PICT resource in resource fork) ?

Thanks in adavnce for any help,

Hyoung B. Min
min@cerc.utexas.edu
The University of Texas at Austin

rick@claris.com (Rick Boarman) (10/10/90)

min@cerc.utexas.edu (Hyoung Bok Min) writes:


>    I can draw and save a picture in a PICT format with MacDraw II. I wan to use
>this picture in my application. To use this, I think it should be converted to
>a PICT resource. How can I do this conversion (from PICT file in data fork to a
>PICT resource in resource fork) ?

>Thanks in adavnce for any help,

>Hyoung B. Min
>min@cerc.utexas.edu
>The University of Texas at Austin

Get PictDetective from Palomar software.  Among many other cool PICT
type utilities they also have a tool that will convert between resource
and data fork based PICT files.

Rick

-- 
* Rick Boarman   *   UUCP:      {ames,apple,portal,sun,voder}!claris!rick
* Claris Corp.   *   Internet:  rick@claris.com
*                *   AppleLink: Boarman         
Opinions are mine alone and do not reflect Claris policy.

mxmora@unix.SRI.COM (Matt Mora) (10/10/90)

In article <11294@claris.com> rick@claris.com (Rick Boarman) writes:
>Get PictDetective from Palomar software.  Among many other cool PICT
>type utilities they also have a tool that will convert between resource
>and data fork based PICT files.


Try clipboard Magician DA by Ed Lai@apple.com

Its cool and its free. 

It will do what you want.


>* Rick Boarman   *   UUCP:      {ames,apple,portal,sun,voder}!claris!rick







-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

pepke@gw.scri.fsu.edu (Eric Pepke) (10/10/90)

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.