What is the best way to set the RGB components of every pixel in a System.Drawing.Bitmap to a single, solid color? If possible, I\'d like to avoid manually loop
The best (in terms of perf, at least) option is to use Bitmap.LockBits, and loop through the pixel data in the scan line, setting the RGB values.
Since you don't want to change the Alpha, you are going to have to loop through each pixel - there is no single memory assignment that will preserve alpha and replace RGB, since they're interleaved together.