[net.micro.mac] Converting MacPaint into a Resource file.

bill@hao.UUCP (Bill Roberts) (09/24/86)

Someone told me not to long ago that I could convert a MacPaint file into PICT
resource by going into ResEdit, opening a new file as a PICT resource file,
and pasting, from the scrapbook, the MacPaint file that one cut and pasted into
the scrapbook earlier.  Then decompile it to create the resource file.  Well, 
this don't work!

	1) When pasting the portion of the MacPaint file into the scrapbook
	   (using the 'PaintCutter' application) only a small portion gets 
	   saved (since the scrapbook is tiny).
	2) I can't see how to paste the scrapbook into the new PICT resource 
	   file from ResEdit1.0D12.  I have to use REdit1.2.  
	3) When I try to "Decompile..." the file in REdit1.2 to create the
	   RMaker source file I don't get nothin substantial.  I get  something
	   like:

	  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	      ...
	   /tmp:MyPict.rsrc

	   Type PICT
	     ,21345 (2)
	   * no representation given (or something like that).
	  
	  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

So, the questions remain:
	A) How does one convert a MacPaint file into a PICT resource so that 
	   the MacPaint file can be displayed in a window (in an application) 
	   at runtime?
	B) Where can I find out how to use ResEdit1.0D12?  Which software 
	   supplement documents it?  And what is the general address to write
	   too to get the various software supplements? 
	C) Or, do I have to right an application to convert MacPaint into a 
	   PICT resource file (or better yet, a bmap resource)?

  >Does anyone have any answers (and/or valid ideas) to these questions?

	If I get a reasonable response, I'll compile it a post it to the net.

--Bill

bezanson@gumby.WISC.EDU (Brian Bezanson) (09/25/86)

In article <232@hao.UUCP>, bill@hao.UUCP (Bill Roberts) writes:
> So, the questions remain:
> 	A) How does one convert a MacPaint file into a PICT resource so that 
> 	   the MacPaint file can be displayed in a window (in an application) 
> 	   at runtime?
> 	B) Where can I find out how to use ResEdit1.0D12?  Which software 
> 	   supplement documents it?  And what is the general address to write
> 	   too to get the various software supplements? 
> 	C) Or, do I have to right an application to convert MacPaint into a 
> 	   PICT resource file (or better yet, a bmap resource)?

Bill
  The way I've heard people describe the procedure (haven't done it yet,
  but will in a future application), is to 1) Copy your paint picture to the
  clipboard using the program of your choice (Paint Cutter, Artisto, MacPaint,
  etc...).  Then open the clipboard and paste in your new picture.  You will 
  not be able to see the entire PICT in the scrapbook since it only shows you
  part of a PICT.  Now go into ResEdit 1.D12 and open up the scrapbook file.
  Look for your PICT and cut/copy it.  Then open up your Application or the
  Applications Resource file (not the RMaker file), and paste it in.  You
  can use the <I>nfo command to change the PICTs ID number, etc...  Then all
  you do is use the appropriate Toolbox routines to Get/Open the PICT and
  display it in your window (don't have the exact toolbox routine names in
  my mind right now).  The error you got in REdit was because it only
  decompiles some resources, and it doesn't support decompiling PICTs at the
  moment.  Hope this helps in your programming quest.
  
  In answer to your plea for help on ResEdit documentation.  You can get that
  in the third supplement (Volume I, Issue 3).  You can now obtain these
  through APDA (Apple Programmer's and Developer's Association) and they used
  to be available from Apple Mailing Facility (these may have been entirely
  moved to APDA by now).
  
  Hope all this has helped.
  
-- 
Brian Bezanson {seismo,ihnp4,allegra,topaz,harvard}!uwvax!gumby!bezanson
Manta Software Corp.				  bezanson@gumby.wisc.edu 

DMB@PSUVMA.BITNET (10/02/86)

I'm one of the num nums who translates macpaint files to pict resources, for
display in a program window. I think the following description is what i do
precisely, and it works all the time. I usually want a RMAKER hex file for
permanent storage, in case the application gets trashed, so i'll include those
steps too.

  -> Doodle in Macpaint until you get the desired picture
  -> "Square Lasso" the portion you want to be your picture
  -> Copy it (using copy under the edit menu)
  -> Open the scrap book
  -> Paste it in the scrapbook    ( using past under the edit menu  )
      -> Note: the picture might be to big for the scrapbook window but it is
               still there in entirety.
  -> Quite MacPaint.
  -> Run Resedit : make sure that if you switch systems you switch scrapbooks
                   so that the right scrapbook is with the resedit system
  -> Open a new file
  -> Open a new pict resource
  -> Open a new pict resource number
  -> Open the scrapbook
  -> Copy (using the copy under edit) the picture
  -> Close the scrapbook
  -> Paste (using the paste under edit menu) the picture into the resource
  -> Close the top window, so that a list of pict resource numbers shows
  -> Click on the appropriate pict resource number
  -> Choose open general under the file menu
  -> Open Mockwrite, or someother word processer da
  -> Copy the hex codes from the pict resource into the blank text file
  -> close and save all windows
  -> In your RMAKER text file, add the lines
     -> TYPE PICT = GNRL
     ->   ,<resourceid>
     ->   .H
     -> and then all the hex codes go here.

I think this is exactly what i do to create the pict resource, and it works
all the time. I hope this works,  it should.

                                   dave

rfl@oddjob.UUCP (Bob Loewenstein) (10/05/86)

I do the same thing, except that if a picture is too large, the
open general doesn't seem to get the binary listing.

~