Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top