Hello, I have two indexed (8-bits) Bitamp, both using the same Palette in C# (.NET Framework 2.0). I want to bit block copy pixels from one onto another on designated coordinates. I had tried to use Graphics class, but get exception that it doesn't work with indexed colors, I tried also with getpixel()/setpixel() but get the same exception. It doesn't need to be quick it just have to work. And I CAN'T convert to non-indexed image and vice-versa - palette is very important for me and I can't loose any information about it.
+1
A:
GDI+ supports indexed formats very poorly. Things got better with Vista which included an update to gdiplus.dll to version 1.10. Nothing you should could on I imagine. You could hack Bitmap.Lock(), dealing with the single byte-per-pixel format is doable. But get these images into a 24 or 32bpp format I'd say.
Hans Passant
2010-08-22 19:28:20
As I said - I can't: even change of the order of colors in palette is unacceptable
PiotrK
2010-08-22 20:11:22