home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20209 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.8 KB

  1. 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
  2. From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Looking at a bit in a bitmap truly bytes. Help!
  5. Message-ID: <1992Dec22.205409.28125@kth.se>
  6. Date: 22 Dec 92 20:54:09 GMT
  7. References: <1992Dec22.004631.14531@midway.uchicago.edu>
  8. Sender: usenet@kth.se (Usenet)
  9. Organization: Royal Institute of Technology, Stockholm, Sweden
  10. Lines: 34
  11. Nntp-Posting-Host: hemul.nada.kth.se
  12.  
  13. In <1992Dec22.004631.14531@midway.uchicago.edu> greg@zaphod.uchicago.edu (Greg Kuperberg) writes:
  14.  
  15. >Icon's mask, already a moral violation of the Object-Oriented
  16. >mentality, and then I have to either find a grafPort somewhere and set
  17.  
  18. Uh?
  19.  
  20. What's non-oo about chasing down the mask? Don't you store objects
  21. of icons in a decent data structure, check which one was clicked
  22. and call the GetMask method of it? Or even better, have the Icon
  23. object know how to check its own mask.
  24.  
  25. >the grafPort's bits to the mask and finally use GetPixel, or I have to
  26. >monkey with the raw bits of the mask packed into bytes.  The first
  27. >method is in practice a really kludgey way to try to stay PC, and maybe
  28.  
  29. Well, cheking the bits directly is not TOO platform-dependent, since
  30. the format of ICN# resources is well defined and won't change...
  31.  
  32. What I would do is open a new port, SetPortBits to
  33. a known scratch space one longword long, and move
  34. the origin and clip so that you know what's going on,
  35. and draw the icon MASK into that port, then DisposePort
  36. the port.
  37.  
  38. Cheers,
  39.  
  40.                         / h+
  41.  
  42. -- 
  43.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  44.    The word "politics" is derived from the word "poly", meaning
  45.    "many", and the word "ticks", meaning "blood sucking parasites".
  46.                      -- Larry Hardiman
  47.