Obtaining a HBITMAP/HICON from D2D Bitmap
- by Tom
Is there any way to obtain a HBITMAP or HICON from a ID2D1Bitmap* using Direct2D?
I am using the following function to load a bitmap:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd756686%28v=vs.85%29.aspx
The reason I ask is because I am creating my level editor tool and would like to draw a PNG image on a standard button control.
I know that you can do this using GDI+:
HBITMAP hBitmap;
Gdiplus::Bitmap b(L"a.png");
b.GetHBITMAP(NULL, &hBitmap);
SendMessage(GetDlgItem(hDlg, IDC_BUTTON1), BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);
Is there any equivalent, simple solution using Direct2D? If possible, I would like to render multiple PNG files (some with transparency) on a single button.