R
Richard Bos
Keith Thompson said:Surely it's simpler to invert the image itself, using the unary "~"
operator, rather than constructing another bitmap and xor'ing against
that.
If that's all you're doing, yes. Often one uses a generic bitblt-like
facility to XOR the entire bitmap with a pattern, or another bitmap, of
one's choice. These facilities are usually heavily optimised, possibly
even more so than a hand-rolled loop to invert all bytes can be. In that
case, one would use the xor-bitblt-like with a 1-filled pattern to
invert it. And that would be the simplest use of XOR, though not the
simplest (but sometimes the most efficient) way to invert a bitmap.
Richard