By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,213 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,213 IT Pros & Developers. It's quick & easy.

FillReversibleRectangle problem

P: n/a

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 ?
May 20 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.