C++/Win32: How to get the alpha channel from an HBITMAP?
I have an HBITMAP containing alpha channel data. I can successfully render this using the ::AlphaBlend GDI function. However, when I call the ::GetPixel GDI function, I never get back values with an alpha component. The documentation does say that it returns the RGB value of the pixel. Is there a way to retrieve the alpha channel values for pixels in an HBITMAP ? I want to be able to detect when to use ::AlphaBlend, and when to use an old-school method for treating a particular colour in the source HBITMAP as transparent. HDC sourceHdc = ::CreateCompatibleDC(hdcDraw); ::SelectObject(sourceHdc,