A faster alternative to the very slow GetPixel() and SetPixel() for .Net System.Drawing.Bitmap
Summary
Anybody who works with images often have probably come across .Net Bitmaps (System.Drawing.Bitmap) with their staggeringly slow GetPixel() and SetPixel() methods. To get around this problem, and to avoid littering my code with gibberish I have written a bitmap wrapper class that wraps a bitmap, locks it, and provides it’s own GetPixel() and SetPixel() functions with which the original bitmap’s image data can be accessed. So for a little extra complication you get easy & fast access to the bitmap data – but how much faster than the native Get/SetPixel() is it? I may add extra accessor methods in the future to cater for other usage patterns and greater efficiency. using System; using System.Drawing; using System.Drawing.Imaging; /// /// Wraps a System.Drawing.Bitmap and provides faster /// GetPixel() and SetPixel() functions for pixel access.