Color c1 = image.GetPixel (7, 400);
Color c2 = Color.Blue;
Console.WriteLine (image.GetPixel (7, 400));
Console.WriteLine (Color.Blue);
Console.WriteLine (c1.Equals(c2));
Console output:
Color [A=255, R=0, G=0, B=255]
Color [Blue]
False
I'm new to C# and I have NO idea why this is returning false. Can anyone please give me some insight as to why this doesn't work?
I'm trying to use it in this context.
for (int i = 0; i < image.Height; i++) //loop through rows
{
for (int j = 0; j < image.Width; j++) //loop through columns
{
//Console.WriteLine ("i = " + i);
//Console.WriteLine ("j = " + j);
if ((image.GetPixel (i, j)) == Color.Blue)
{
return new Tuple<int, int>(i,j);
}
if (i == image.Height-1 && j == image.Width-1)
{
Console.WriteLine ("Image provided does not have a starting point. \n" +
"Starting points should be marked by Blue.");
Environment.Exit (0);
}
}
}