I can load a hbitmap
into a hdc like this:
Gdiplus::Color Color{ 255, 255, 255 };
hBitmap = NULL;
Gdiplus::Bitmap* bitmap = Gdiplus::Bitmap::FromFile(L"home.png", false);
if (bitmap)
{
bitmap->GetHBITMAP(Color, &hBitmap);
delete bitmap;
}
BITMAP bm;
GetObject(hBitmap, sizeof(bm), &bm);
HDC hDCMem = CreateCompatibleDC(NULL);
HBITMAP hBitmapOld = (HBITMAP)SelectObject(hDCMem, hBitmap);
How could I do the reverse, getting back a bitmap loaded into a specific hdc
?
I would need first, retrieve the hbitmap
and then the bitmap
from it? How?