How to Create a Gdiplus::Bitmap from an HBITMAP, retaining the alpha channel information?
问题 When I create a new Gdiplus::Bitmap using the Bitmap::FromHBITMAP function, the resulting Bitmap is opaque - none of the partial transparency from the original HBITMAP is preserved. Is there a way to create a Gdiplus::Bitmap from an HBITMAP which brings across the alpha channel data? 回答1: I think working code is more useful than instructions, so: #include <GdiPlus.h> #include <memory> Gdiplus::Status HBitmapToBitmap( HBITMAP source, Gdiplus::PixelFormat pixel_format, Gdiplus::Bitmap** result