Is there a way to convert HICON to HBITMAP?
thank you.
Printable View
Is there a way to convert HICON to HBITMAP?
thank you.
Off the top of my head, use DrawIcon to draw it to a DC with a bitmap selected into it and there you go.
Yes. Use GetIconInfo or draw the icon to a bitmap using DrawIconEx. See threads.
wow, it's so short and simple... and not DCs. Thank you.
Code:HBITMAP hBitmap;
HICON hIcon;
ICONINFO iconinfo;
hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(ID_ICON));
GetIconInfo(hIcon, &iconinfo);
hBitmap = iconinfo.hbmColor;
This's what i'm finding. Thank so much if it work.
No, it's wrong.
You must pass throug a DIB Section or a comp. DC.
See MSDN (WSDK) or Google Groups for the usual methods (comp.os.ms-windows.programmer.win32
and others)