Andrew Vos created a nice VB.NET class called FastPixel which will copy a bitmap to an array of the single bytes which can then be modified through the well-known SetPixel, GetPixel and Clear methods. Since these are now only some in-memory operations it is blazing fast compared to the standard functions.
Someone posted a C# version in the comments which had problems with bitmaps with an odd row count. I searched the net and found some replacement code to use instead. The only drawback is, that the new code is unsafe code.
Download the source code here: fastpixel.cs (4.64 KiB, 45 downloads)
Bitmap myBitmap = new Bitmap(100, 100, System.Drawing.Imaging.PixelFormat.Format24bppRgb); FastPixel fp = new FastPixel(myBitmap); fp.Lock(); // copies bitmap to array and locks it fp.Clear(Color.White); fp.SetPixel(10, 10, Color.Black); // ... do some more ... fp.Unlock(true); // true = write array to bitmap