pixel indexed bitmaps resist being drawn upon
Hello,
I am constructing a bitmap via the 'unsafe' constructor:
Bitmap myBitmap = new Bitmap(int w ,int h, int stride, PixelFormat frm, IntPtr dataPtr)
and then, I am drawing myBitmap on some form. However, I require double buffering
to avoid flickering, so I try to get a graphics object from the bitmap, as in:
Graphics g = Graphics.FromImage(myBitmap)
and this survives compilation. But on runtime, I get an System exception telling that:
"A Graphics object cannot be created from an image that has an indexed pixel format"
So my question is:
How do I do double buffering with indexed pixel format bitmaps?
Yossi