Reputation: 1056
I am using MFC, now i have a bitmap object, obtained by using:
Gdiplus::Bitmap* bmp = Gdiplus::Bitmap::FromStream(pStream);
How to convert this bmp object into HBITMAP? I used :
HBITMAP hBitmap = NULL;
bmp->GetHBITMAP(Color::White, &hBitmap);
but it can't, hBitmap always return 0xcccccccc and notices that {unused=??? }. What can i do?
Upvotes: 0
Views: 1455
Reputation: 15375
Not a direct answer but a way to load a stream into a bitmap. It doesn't need GDI+ at all.
CImage is a direct slim wrapper for a HBITMAP object from the ATL.
Upvotes: 0