home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12930 < prev    next >
Encoding:
Text File  |  1992-07-23  |  2.6 KB  |  62 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!darwin.sura.net!jvnc.net!yale.edu!yale!gumby!kzoo!k044477
  3. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  4. Subject: Re: q: mask/mask region for color object animation
  5. Message-ID: <1992Jul23.163847.506@hobbes.kzoo.edu>
  6. Organization: Kalamazoo College
  7. References: <ANDRE.92Jul22172747@flash.cs.pitt.edu>
  8. Distribution: na
  9. Date: Thu, 23 Jul 1992 16:38:47 GMT
  10. Lines: 50
  11.  
  12. andre@flash.cs.pitt.edu (Andre "A Mac Plumber" Srinivasan) writes:
  13. >
  14. >i am trying to drag a picture around the screen...
  15. >
  16. >at first i was just drawing the pict to the offscreen gworld, but
  17. >since the object is not a perfect rectangle (it's an arrow), parts of
  18. >the background get erased by the pict rectangle. ...
  19. >i'll create a pixmap of the pict, copy the pixmap to a bitmap and
  20. >create a maskrgn with BitMapToRegion which i'll use in conjuction with
  21. >copybits.
  22.  
  23. Incidentally, I think it'll be a lot faster if you use CopyMask and
  24. leave the maskRgn NULL, as you did later.
  25.  
  26. >i checked the
  27. >bitmap by copying it to my on screen port and found that i indeed had
  28. >an outline rather than a solid black arrow.
  29. >
  30. >i tried creating a searchproc that changed non white into black, but
  31. >this didn't work.  ...  i have to believe (until told otherwise)
  32. >that copybits does not call the search proc if the destination is a
  33. >bitmap.
  34.  
  35. This makes sense.  I don't know why it _would_, since GDevices and the
  36. concept of a color environment (of which the search proc is a part) only
  37. work in Color QuickDraw.
  38.  
  39. >so how do i create either a mask to use with copymask or a mask region
  40. >to use with copybits so when i copybits my pixmap to my gworld, only
  41. >the non white pixels get copied and i end up with a color object?
  42.  
  43. I'd suggest two possibilities:
  44.  
  45. (1) Create a 1-bit-deep PixMap, with the appropriate two-color color
  46. table, and copy to it instead of a BitMap.  Use your search proc if you
  47. have to.  Then, you can either convert it to a BitMap yourself, call
  48. BitMapToRegion on it (it works on 1-bit-deep PixMaps), or use
  49. CopyDeepMask.
  50.  
  51. (B) Forget about using CopyBits to make the mask;  just scan through
  52. the PixMap yourself and write ones and zeros to the BitMap manually.
  53.  
  54. I suggest the latter;  search procs are another level of complication,
  55. and unless you convert the PixMap to a BitMap and use CopyMask, you'll
  56. have to require 32-Bit Quickdraw.  Might as well write the bits
  57. yourself...
  58. -- 
  59.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  60.  I'm having a lot of trouble seeing how a request that you "shut up" can be
  61.  interpreted as "looking to other people for validation."      - Tim Pierce
  62.