In the following code:
Bitmap bmp = new Bitmap((int)ArrayHeight, (int)ArrayWidth, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
Graphics gBmp = Graphics.FromImage(bmp);
gBmp.CompositingMode = CompositingMode.SourceCopy;
System.Drawing.Color green = System.Drawing.Color.FromArgb(0x40, 0, 0xff, 0);
System.Drawing.Brush greenBrush = new SolidBrush(green);
gBmp.FillPolygon(greenBrush, polygonPoints);
for (int i = 0; i < ArrayHeight; i++)
{
for (int j = 0; j < ArrayWidth; j++)
{
System.Drawing.Color pixel = bmp.GetPixel(i,j);
if (pixel.IsSystemColor.Equals("green"))
{
PolyArray[i, j] = (byte)TerrainValue;
}
}
}
I want to check to see if a the pixel at that location in the bitmap is the system drawing color 'green', but it is never returning true.
What am I doing wrong?