Tinyclr - bitmap

here is some code to create a bitmap, draw a line and srt two pixels a specific color, we then loop through pixels to find all the colored pixels…well thats what is suppose to happen, any ideas?

Bitmap bitmap = new Bitmap((int)width, (int)height))
Graphics graphics = Graphics.FromImage(bitmap))

graphics.Clear(Color.Black);
graphics.DrawLine(new Pen(new SolidBrush(Color.Blue)), (int)x1, (int)y1, (int)x2, (int)y2);
graphics.Flush();

bitmap.SetPixel((int)x1, (int)y1, Color.Red);
bitmap.SetPixel((int)x2, (int)y2, Color.Green);

for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++)
switch (bitmap.GetPixel(x, y).ToArgb())
{
case -65536: // red
case -16776961: // blue
case -16744448: // green

			// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
			// WE NEVER REACH THIS PART
			// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

			break;
	}

were you trying to reply to your last post?

i wasn’t getting any responses thought i’d start a fresh conversation

What is the question it the problem? What are you trying to do? I didn’t understand, sorry.

When setting pixels on the bitmap its not being reflected, the code above creates a bitmap, draws a line then proceeds to locate the colored pixels, but all pixels are black, this is running on a G400D module

Your code has more to it than just drawing. Please only draw to the screen and provide the smallest possible example that produces the issue.

if you ignore the memory stream block that is the smallest it can be

I am not seeing an issue. Can you please provide a complete example? One that shows the issue on a screen. And what board are you testing it on?

can you not draw to a bitmap?