Hi,
BitBlt doesn't support a "three-way-copy" at this point (e.g., take pixels from two sources, combine them and store them into a third form) so the best you can do is to use a temporary form for compositing. E.g.
| tmpForm | tmpForm := Form extent: srcForm extent depth: srcForm depth. srcForm displayOn: tmpForm. "make a copy of src" maskForm displayOn: tmpForm at: 0@0 rule: Form bitAnd. "mask out pixels" tmpForm displayOn: dstForm at: 0@0 rule: Form paint. "copy non-zero pixels"
Note: above code is not tested. In particular 'Form bitAnd' might be the wrong way around - check out the various combination rules; one of them will do the trick.
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Stephan B. Wessels Sent: Wednesday, October 30, 2002 1:07 PM To: Squeak mailing list Subject: BitBlt question
I need some direction from someone more familiar with the particulars of using BitBlt.
In my current project there are 3 forms: srcForm dstForm maskForm of which scrForm and dstForm are 32-bit depth and the maskForm is 1-bit depth. The maskForm contains black pixels in a non-rectangular shape.
I want to copy pixels from the scrForm onto the dstForm using the maskForm for inclusion. The srcForm is smaller in extent than the dstForm. The maskForm is the same size as the dstForm. I've tried a number of things, and frankly went into this believing it would be very simple, but ended up implementing pixel copies. There must be a smarter way.
- Steve