The actual information per bit depends on the
PixelFormat
:
http://msdn.microsoft.com/en-us/library/system.drawing.imaging.pixelformat.aspx[
^].
[EDIT]
As Philippe Mori correctly pointed out in his comment,
Color
type cannot be used to solve this problem, it is designed to serve only the pixel formats using 8 bits per color component.
[END EDIT]
You can immediately fill in the pixel memory for any pixel format by using
System.Drawing.LockBits
:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits.aspx[
^].
Also, this is the best for performance. WPF also has similar approach.
—SA