On 03 Jul 96 Gary Weinfurther said to Bryan Smith...
BS> My understanding is that XOR flips a bit in Canvas.Pixels if that bit is
BS> set in the mask $00FFFFFF, or leaves it alone if that bit is not set.
GW> XOR will result in 1 if and only if one of the two operands is 1.
GW> 0 XOR 0 = 0
GW> 1 XOR 0 = 1
GW> 0 XOR 1 = 1
GW> 1 XOR 1 = 0
I think we are saying the same thing. e.g. if the right column (the mask)
is 1, then the output is the NOT (flip) of the left column. But if the
right column is 0, then the output is the unchanged left column.
Problem is, it does not seem to work like that with the Canvas. For
example, if the canvas color is clBlue = $00FF0000, and you BitBlt in
some white-on-black text using the SRCINVERT operator, you might expect to
get clYellow $0000FFFF text, but you get clOlive $00007F7F. Likewise if the
canvas is clNavy, $007F0000 then you get clYellow $0000FFFF text.
It seems to behave as though what is being XOR'ed is not the clNavy LongInt
representation of $007F0000 but rather a 4-bit "DOS text foreground colour"
representation of clNavy as $1, where 1=blue, 2=green, 4=red, 8=brightness.
The NOT of $1 (dark blue) is $E, i.e. bright yellow, which is what you in
fact see.
Anybody know where this stuff is documented ?
--- PPoint 2.00
---------------
* Origin: Kingston, Canada (1:249/109.11)
|