如果我有一个BITMAP
named bitmap
,如何将其转换为 HBITMAP?
到目前为止,我已经尝试过:
HBITMAP hbm = (HBITMAP)&bitmap; //doesn't work
HANDLE hand = &bitmap;
HBITMAP hbm = hand; //doesn't work
CImage cim;
cim.Attach(&bitmap);
HBITMAP hbm = cim.Detach(); //definitely doesn't work
CBitmap cbm;
cbm.Attach(bitmap);
CImage cim;
cim.Attach(cbm.Detach());
HBITMAP hbm = cbm.Detach(); //desperate I know, horribly failed
必须有一些简单的,一条线的方法来做到这一点,但我就是找不到。我能得到一些帮助吗?