T
Typpo
Hi all,
I'm trying to compare a color returned by a Bitmap's GetPixel method to
a normal static color of the Color class. My problem: after setting a
pixel to a certain color, the color returned by GetPixel isn't
considered the same color anymore. Example code:
bmp.SetPixel(0, 0, Color.Blue);
Color cc = bmp.GetPixel(0, 0);
if (cc.Equals(Color.Blue))
{
MessageBox.Show("Pixel is blue");
}
else
{
MessageBox.Show("Pixel isn't blue");
}
....this program will always tell me that the pixel isn't blue. Is there
anything I'm doing wrong? What's the proper way to compare these colors?
Thanks in advance.
I'm trying to compare a color returned by a Bitmap's GetPixel method to
a normal static color of the Color class. My problem: after setting a
pixel to a certain color, the color returned by GetPixel isn't
considered the same color anymore. Example code:
bmp.SetPixel(0, 0, Color.Blue);
Color cc = bmp.GetPixel(0, 0);
if (cc.Equals(Color.Blue))
{
MessageBox.Show("Pixel is blue");
}
else
{
MessageBox.Show("Pixel isn't blue");
}
....this program will always tell me that the pixel isn't blue. Is there
anything I'm doing wrong? What's the proper way to compare these colors?
Thanks in advance.