This does not agree with MSDN's description of the function.
According to MSDN, InitializeFromBitmap should compute a palette based on the contents of the (presumably) non-paletted bitmap data.
Vincent Povirk madewokherd@gmail.com wrote:
This does not agree with MSDN's description of the function.
According to MSDN, InitializeFromBitmap should compute a palette based on the contents of the (presumably) non-paletted bitmap data.
For a bitmap with palette my implementation should be good enough.
This does not agree with MSDN's description of the function.
According to MSDN, InitializeFromBitmap should compute a palette based on the contents of the (presumably) non-paletted bitmap data.
For a bitmap with palette my implementation should be good enough.
For a bitmap with a palette you can easily end up with too many colors, and no transparent color when one is requested. It doesn't get us any closer to a real implementation, and if we had one it would always be preferable this one. That case of a bitmap with a palette is exactly when the method is least likely to be used, so mostly you're just leaving the problem and making it harder to identify the cause.