Create or Save bitmap PixelFormat.Format8bppIndexed
Bitmap bitmap = new Bitmap(100, 100, PixelFormat.Format8bppIndexed);
panel1.DrawToBitmap(bitmap, new System.Drawing.Rectangle(0, 0, 100, 100));
bitmap.Save(@"c:\\test.bmp", ImageFormat.Bmp);
System.Exception: 'A Graphics object cannot be created from an image that has an indexed pixel format.'
What I have tried:
Bitmap bitmap = new Bitmap(100, 100, PixelFormat.Format8bppIndexed);
panel1.DrawToBitmap(bitmap, new System.Drawing.Rectangle(0, 0, 100, 100));
bitmap.Save(@"c:\\test.bmp", ImageFormat.Bmp);