Page 1 of 1

Re: Pictures as resources

Posted: September 23rd, 1984, 3:12 am
by Info-Mac
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 UW 5/3/83; site uw-beaver
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!info-mac
From: info-mac@uw-beaver (info-mac)
Newsgroups: fa.info-mac
Subject: Re: Pictures as resources
Message-ID:
Date: Thu, 16-Aug-84 04:27:11 EDT
Article-I.D.: uw-beaver>.1482
Posted: Thu Aug 16 04:27:11 1984
Date-Received: Fri, 17-Aug-84 00:44:58 EDT
Sender: daemon@uw-beave
Organization: U of Washington Computer Science
Lines: 62

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