How to draw RGB bitmap to window using GDI?
问题 I have an image in memory with the following byte layout blue, green, red, alpha (32 bits per pixel) The alpha is not used. I want to draw it to a window using GDI. Later I may want to draw only a smaller part of it to the window. But the bitmap in memory is always fixed at a certain width & height. How can this bitmap drawing operation be done? 回答1: SetDIBitsToDevice and/or StretchDIBits can be used to draw pixel data directly to a HDC if the pixel data is in a format that can be specified