I am rendering a bitmap where each pixel may be stretched to occupy many
screen pixels. I need the solid color of each pixel to be preserved, not
dithered or interpolated in any way.

My sample code is this:

g.ResetTransform();

Bitmap bmDemo = new Bitmap(2, 2, PixelFormat.Format32bppArgb);
int Alpha = 255;

bmDemo.SetPixel(0, 0, Color.FromArgb(Alpha, Color.White));
bmDemo.SetPixel(1, 0, Color.FromArgb(Alpha, Color.Red ));
bmDemo.SetPixel(0, 1, Color.FromArgb(Alpha, Color.Red ));
bmDemo.SetPixel(1, 1, Color.FromArgb(Alpha, Color.White));

g.DrawImage(bmDemo, new Rectangle( 5, 5, 2, 2)); // OK, no stretch
g.DrawImage(bmDemo, new Rectangle( 8, 8, 4, 4)); // not OK
g.DrawImage(bmDemo, new Rectangle(14, 14, 10, 10)); // not OK

The first DrawImage() does not stretch and the 4 rendered pixels are as they should be.

The second and third DrawImage() stretch the 2x2 bitmap into 4x4 and 10x10 on the screen. Both generate some pixels that are white, some that are red and many others that are a combination of red/white, red/black (black is my background color), white/black or red/white/black.

In each case, I want all 4 bitmap pixels to be rendered as either red or
white, no matter how many screen pixels they occupy.

I have tried all the Graphics, Bitmap, and InterpolationMode options that I
can find but have not found the right combination.

I have a working implmentation using WIN32 GDI calls, principally StretchDIBits(). I need the same behavior in GDI+.

Thanks ...

Don Walker