I convert a bitmap from Format24bppRgb to Format8bppIndex ed this way:
Would you please tell me where is the problem?
Code:
Bitmap bmp = new Bitmap("c:\\flower.bmp");
BitmapData bmData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
Bitmap temp = new Bitmap(bmData.Width, bmData.Height, bmData.Stride, PixelFormat.Format8bppIndexed, bmData.Scan0);
bmp.UnlockBits(bmData);
pictureBox1.Image = temp; //But then the result is a destroyed image:
Comment