I want to change size in ColorPalette.Entries. If I do like below, I got error. How can change size of Entries in correct way?
Bitmap bm = new Bitmap(Width, Height,PixelFormat.Format8bppIndexed);
var palette = bm.Palette;
var colr = palette.Entries;
Array.Resize(ref colr, 4);
Error:
'ColorPalette.Entries' cannot be assigned to -- it is read only
Why would you change the size for 8bppIndex from 256 to 4? The colorindices in the image depends on 256 indices. You don't want an index out of bounds kind of thing in the image. What if the pixel should be index 5? Too bad there isn't a
Format2bppIndexed
format.