I have a bitmap from the screen selected into a memory device context, and also into a window device context. I want to put it to a BMP file. How can get the colour table of the selected bmp? Or is the colour table trivial, not weighted for some colours over others? If so I can generate such a table for each case (monochrome, 16-colour, 256-colour) if I know what it looks like. GetDIBColorTable is only good after CreateDIBSection, not for bitmaps generally. GetObject gets only the BITMAPHEADERINFO. GetDIBits gets everything except the colour table. Thx.
Larry, If the BMP is 32bit, then it won't have a colour table. it will just have the RGB values, you'd have to create one by calculating it yourself. If fact, if I remember correctly, 32bit BMP's don't have colour tables.... anyone feel free to tell me I'm wrong. umbongo
Yes, I know, Umbongo. 24-bit bmp's have no table. As for 32-bits I have seen no documentation. But I want to be able to save the window contents when the user is in 256 colours or fewer, so I was running my own machine with 256. When I call GetDIBits, I get the bitmap header, then 0's where there should be a colour table, then the bitmap data itself.