home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!think.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!kth.se!hemul.nada.kth.se!d88-jwa
- From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Looking at a bit in a bitmap truly bytes. Help!
- Message-ID: <1992Dec22.205409.28125@kth.se>
- Date: 22 Dec 92 20:54:09 GMT
- References: <1992Dec22.004631.14531@midway.uchicago.edu>
- Sender: usenet@kth.se (Usenet)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Lines: 34
- Nntp-Posting-Host: hemul.nada.kth.se
-
- In <1992Dec22.004631.14531@midway.uchicago.edu> greg@zaphod.uchicago.edu (Greg Kuperberg) writes:
-
- >Icon's mask, already a moral violation of the Object-Oriented
- >mentality, and then I have to either find a grafPort somewhere and set
-
- Uh?
-
- What's non-oo about chasing down the mask? Don't you store objects
- of icons in a decent data structure, check which one was clicked
- and call the GetMask method of it? Or even better, have the Icon
- object know how to check its own mask.
-
- >the grafPort's bits to the mask and finally use GetPixel, or I have to
- >monkey with the raw bits of the mask packed into bytes. The first
- >method is in practice a really kludgey way to try to stay PC, and maybe
-
- Well, cheking the bits directly is not TOO platform-dependent, since
- the format of ICN# resources is well defined and won't change...
-
- What I would do is open a new port, SetPortBits to
- a known scratch space one longword long, and move
- the origin and clip so that you know what's going on,
- and draw the icon MASK into that port, then DisposePort
- the port.
-
- Cheers,
-
- / h+
-
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
- The word "politics" is derived from the word "poly", meaning
- "many", and the word "ticks", meaning "blood sucking parasites".
- -- Larry Hardiman
-