Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!felix!dhw68k!thecloud From: thecloud@dhw68k.cts.com (Ken McLeod) Newsgroups: comp.sys.mac.programmer Subject: Re: Drawing SICNs Message-ID: <21274@dhw68k.cts.com> Date: 23 Mar 89 11:25:17 GMT References: <19167@srcsip.UUCP> Reply-To: thecloud@dhw68k.cts.com (Ken McLeod) Organization: Wolfskill & Dowling residence; Anaheim, CA (USA) Lines: 42 In article <19167@srcsip.UUCP> mnkonar@srcsip.UUCP (Murat N. Konar) writes: >Does anyone out there have a code fragment that demonstrates how >to plot a SICN? I can't find anything about this in IM or the >Tech Notes. I did find out that SICN stands for "Script Symbol >Icon" and not "Small Icon" as is the popular interpretation. The following code appeared in MacTutor a while back. I think it came from David Dunham, but I'm not positive. I also recall that there were some caveats attached, but I don't remember them. Hope it helps anyway. /* PlotSICN.c Draw the sicnNumth small icon of sicn in sicnRect of window. Note that a dereferenced handle is used (*sicn), but there's no need to lock it, since CopyBits() won't alter the heap configuration unless a picture or region is being recorded. */ PlotSICN (sicn, sicnRect, sicnNum, window) Handle sicn; Rect *sicnRect; short sicnNum; WindowPtr window; { BitMap sicnBits; /* set up the bitmap */ sicnBits.rowBytes = 2; SetRect(&sicnBits.bounds, 0, 0, 16, 16); sicnBits.baseAddr = *sicn + (sicnNum * 32); /* blit the sicn */ CopyBits(&sicnBits, &window->portBits, &sicnBits.bounds, sicnRect, srcCopy, NIL); } -- ========== ....... ============================================= Ken McLeod :. .: felix!dhw68k!thecloud@ics.uci.edu ========== :::.. ..::: InterNet: thecloud@dhw68k.cts.com //// =============================================