Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!ucselx!crash!pro-sol.cts.com!mdavis From: mdavis@pro-sol.cts.com (Morgan Davis) Newsgroups: comp.sys.mac.programmer Subject: Re: Help with icl8's... Message-ID: <3681@crash.cts.com> Date: 25 Jul 90 23:16:07 GMT Sender: root@crash.cts.com Lines: 44 In-Reply-To: message from markt@wpi.wpi.edu Drawing an icl8 is fairly easy. The icl8 consists of 1K of pixel data (a pixMap). All you do to draw it is use CopyBits to copy the icl8's pixMap to your destination pixMap using a 32 x 32 pixel rectangle. The rowbytes value of the pixMap should be 32. Here is a short routine that took me a while to figure out. If anyone knows of a better way to do this, PLEASE let me know. /***************************************************************************** ** ** PlotIcl8 ** ** Like PlotIcon, this function uses the same arguments, only the the icon's ** handle belongs to a 1K icl8 resource. ** **/ void PlotIcl8 (register Rect *dest, register Handle theIcon) { register PixMapHandle pm; register byte hAttrs; CGrafPtr gp; GetPort (&gp); pm = NewPixMap(); HLock (pm); CopyPixMap (gp->portPixMap, pm); hAttrs = HGetState (theIcon); HLock (theIcon); (**pm).baseAddr = *theIcon; HSetState (theIcon, hAttrs); (**pm).rowBytes = 32 | 0x8000; SetRect(&(**pm).bounds, 0, 0, 32, 32); CopyBits(*pm, &(*gp).portPixMap, &(**pm).bounds, dest, 0, NULL); DisposPixMap (pm); } UUCP: crash!pnet01!pro-sol!mdavis ProLine: mdavis@pro-sol ARPA: crash!pnet01!pro-sol!mdavis@nosc.mil MCI Mail: 137-6036 INET: mdavis@pro-sol.cts.com America Online, BIX: mdavis