ColorPalette

  • Thread starter Thread starter Jeroen Ceuppens
  • Start date Start date
J

Jeroen Ceuppens

Hi,

I want to "translate" this code into working code for the CF:
Can anybody give me tips about what could be the best way to make a
ColorPalette class?
Or how the values in the ColorPalette are stored?

Thx

JC

ColorPalette pt = bmp.Palette;

int n=1;

for (int m = 0; m < 256; m++)

{

argb = (int[])arrayList[m];

pt.Entries[m] = Color.FromArgb( argb[0],argb[1],argb[2],argb[3]);

}
 
Hi Jeroen,

There is no inherent support for accessing the palette in the .NET Compact
Framework. If you are working with files then you will have to load the
file and parse it yourself but it is not to bad. Provided there is no
compression, it is just a BITMAPFILEHEADER followed by a BITMAPINFOHEADER,
then the palette (if there is one) and then the pixel information. Remember
that the pixels have to be 4 byte aligned for each row.

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top