Path: utzoo!mnetor!uunet!husc6!rutgers!super.upenn.edu!eecae!nancy!umix!tardis!pepe!shane
From: shane@pepe.cc.umich.edu (Shane Looker)
Newsgroups: comp.sys.mac
Subject: Re: PICT's in LSC
Message-ID: <411@tardis.cc.umich.edu>
Date: 14 Dec 87 15:49:54 GMT
References: <2592@cbdkc1.ATT.COM> <667@lsrhs.UUCP>
Sender: usenet@tardis.cc.umich.edu
Reply-To: shane@pepe.cc.umich.edu (Shane Looker)
Organization: University of Michigan Computing Center, Ann Arbor
Lines: 42
Keywords: Stress! Frustration!
In article <667@lsrhs.UUCP> schmidt@lsrhs.UUCP (Chris Schmidt) writes:
>In article <2592@cbdkc1.ATT.COM> joe@cbdkc1.UUCP (Joseph !. Judge) writes:
>>WHY don't these work? WHAT specific code, exactly, would take a PICT rsrc and
>>show it in a screen???????
>
>You've done the right thing creating the PICT resource. Now your code's
>gotta do something *like* the following.
>
> ClipRect(destrec); /*an odd, but necessary thing*/
> mypic = OpenPic(destrec);
> myres = GetResource("\pPICT",ID);
>
> /* Careful now -- I don't know if your compiler will regard
> *mypic as a proper lvalue -- I'm translating from assembly . . .*/
>
> *mypic = *myres;
> DrawPicture(mypic);
>------------------------------------------------------------------------
>Chris Schmidt/Lincoln-Sudbury High School/390 Lincoln Rd/Sudbury/Ma/01776
> (617) 926-3242 -----> mit-caf!lsrhs!schmidt@eddie.mit.edu
I'm not sure why you are doing an OpenPic. Try the following (trust me, my
code *always* works):
Rect destRec;
Handle myRes;
unsigned long resname;
ClipRect(destRec); /* you need this I think */
resname = 'PICT'; /* Stuff the res type into 4 bytes */
/* you may need to make this hex, then stuff it in */
myRes = GetResource((ResType)resname, ID);
DrawPicture((PicHandle) myRes);
And away you should go. This may be totally wrong of course, but I don't want
to try this under LSC with MulitFinder.
Shane Looker | "He's dead Jim,
shane@pepe.cc.umich.edu | you grab his tricorder,
uunet!umix!pepe.cc.umich.edu!shane | I'll get his wallet."
Looker@um.cc.umich.edu