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