Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Drawing SICNs Message-ID: <28496@ucbvax.BERKELEY.EDU> Date: 22 Mar 89 09:37:58 GMT References: <19167@srcsip.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 34 Here is what I use to draw a sicn: /* DrawSicn - draw a sicn at the current cursor position. Move the cursor past the sicn. A sicn is treated like a kind of character, so use the character's transfer mode. */ void DrawSicn(id)Integer id;{ static Rect src = {0, 0, 16, 16}; DrawSicnPart(id, &src); } /* DrawSicnPart - draw a sicn at the current cursor position. Like DrawSicn, see above, but takes a sicn relative rectangle as the src. */ void DrawSicnPart(id, srcP)Integer id;Rect *srcP;{ Rect dest; static BitMap b = { NIL, 2, {0, 0, 16, 16}}; dest = *srcP; OffsetRect(&dest, thePort->pnLoc.h, thePort->pnLoc.v - (dest.bottom - dest.top)); Move(2 + (dest.right - dest.left), 0); HLock(sicnHandle); b.baseAddr = *sicnHandle + id*2*16; CopyBits(&b, &thePort->portBits, srcP, &dest, thePort->txMode, NIL); HUnlock(sicnHandle); } --- David Phillip Oster --"When we replace the mouse with a pen, Arpa: oster@dewey.soe.berkeley.edu --3 button mouse fans will need saxophone Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --lessons." - Gasee