Hi,
I've been trying to use ControlPaint.FillReversibleRectangle(Rectangle,
Color) to fill the interior
of a rubber rectangle with a color in a form. Since the function xor's the
rectangle's color with the
background color of the form I created a new color by xor'ing the
corresponding RGB values which
I used as a parameter to the function. Xor'ing this color once again with
the background
should produce the desired color. This works, but for some reason it only
works for
a limited number of colors. Most turn out black or some other color. Here's
the code I use
to xor the background and rectangle colors:
byte r = this.BackColor.R;
byte g = this.BackColor.G;
byte b = this.BackColor.B;
r ^= Color.Lavender.R;
g ^= Color.Lavender.G;
b ^= Color.Lavender.B;
this.rectColor = Color.FromArgb(255, r, g, b);
Am I doing something wrong here or is there a bug in the function ?