I'm rendering an image into a System.Drawing.Bitmap and subsequently drawing it into a window, however I can see that the edges are being anti-aliased. How do prevent this?
Some more detail. The bitmap is created like thus:
new Bitmap (this.Width, this.Height, Imaging.PixelFormat.Format32bppArgb)
I then set pixels to either Color.Black or Color.White. I've tried using both Bitmap.SetPixel and writing bytes directly to the bitmap data using Bitmap.LockBits.
Once the bitmap is ready I draw it in my Form.OnPaint override:
pea.Graphics.DrawImage
( !this.bitmap
, this.ClientRectangle
, new Rectangle (0, 0, this.Width, this.Height)
, GraphicsUnit.Pixel
)
Every pixel should either black or white however I can see that pixels at the edges are grey.