On Oct 27, 2007, at 7:57 AM, Andreas Falkenhahn wrote:
I don't want alpha transparency. I just need a 1-bit transparency
level,
i.e. only two states: visible pixel/invisible pixel. I don't need
alpha.
1-bit is just a special case of general alpha transparency. If you
look closer at what the sample you mentioned does, in the Compositing
case it just returns an empty *opaque* region - which indicates that
the alpha channel for the window should not be ignored. That's all
that region code does, describes the area of the window for which
alpha should be ignored (and forced to 1.0). If the alpha channel in
the rest of the window happens to be 1.0 as well, then you'll get a
solid window rather than a transparent one.
To support transparency in non-compositing mode, the sample uses an
additional handler for the DrawContent event to set the window's alpha
to 0.0. After that, any Quickdraw calls that are made to draw to the
window then force the alpha underneath those painted areas to 1.0. You
can see this as the "erase rect" halo around the OK button in the Non-
compositing window vs the Compositing one.
At the end of the day, it's the window server that gives you
transparency, and it relies on the window's alpha channel to provide
that. Quickdraw unilaterally sets that alpha value to 1.0. Alpha ==
1.0 and alpha == 0.0 are just special cases that say paint or ignore
that pixel rather than blend.
You may be able to avoid the issue by using a masking region, but it's
been a long time since I used Quickdraw routinely so I have no idea if
it will work. But the most sustainable solution is to move to Quartz.
--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.
David Duncan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden