[fa.info-mac] Pictures as resources

info-mac@uw-beaver (info-mac) (08/09/84)

From: preese%ucblapis.CC@Berkeley
Has anyone created pictures as resources?  We are developing Physics
instruction for the Mac and would like to define some windows
that include pictures.  'Inside Macintosh' indicates that this
is feasible but we haven't found details for defining and
placing pictures in a resource file.  Any help would be
appreciated.

Philip East
Phil Reese
preese%ucblapis.CC@Berkeley.ARPA

info-mac@uw-beaver (info-mac) (08/16/84)

From: decvax!decwrl!sun!apple!johan (Johan Strandberg)
How to use pictures in a Mac program?

Very simple!

	1. Draw a picture in MacPaint.

	2. Select the picture with the selection frame
	   or the lasso.

	3. Copy the picture into the scrap.

	4. Paste it into the Scrapbook.

	5. Exit MacPaint.

	6. Make a duplicate of the "Scrapbook File". (Normaly
	   found in the system folder.)

	7. Run the "Resource Mover".

	8. Open the duplicate of the "Scrapbook File" and open each
	   "PICT" resource therein.

	9. Change the resource numbers to something nice that
	   means something to your application.

       10. Remove any pictures you don't want as well as the
	   resource "SMAP". (It's used internaly by Scrapbook).

       11. Copy the resources over to the code file of your
	   program.

       Note that step 11 would have to be re-done after each recompile
       of the codefile. To eliminate that problem change the name of
       the duplicated Scrapbook File to something like: YourApp.rsrc

       Then add the line:

		dummy := OpenResFile('YourApp.rsrc');

       This will cause the file YourApp.rsrc to be searched first for
       any resources. There is no need to remove this code once you
       finaly move the resources from the temporary resource file
       (YourApp.rsrc) and into your application since the open will
       simply fail and the resource will be found in the program file
       instead.

       12. Fetch the picture resource with a:

		pic := GetPicture(theId);

	Good Luck!


	Sincerly yours,
	Johan
____________________________

	Johan Strandberg
	Apple Computer Education Research Group [ERG]
	{mtxinu,dual,nsc,voder,idi,ios,sun}!apple!johan