0
Reply

pixel indexed bitmaps resist being drawn upon

culligoola

culligoola

Oct 13 2004 9:00 AM
1.6k
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