I\'m trying to create a Windows-compatible icon using a pixel buffer. The Surface class loads an image and saves it as an unsigned int array internally (0xRRGGBB).
I
Use CreateIcon if you want to pass the raw bytes data from the AND and XOR mask.
If instead you want to be able to use HBITMAP
s, you can use CreateIconIndirect. Using this API, you can can even create icons with an alpha channel if you so desire.
Take a look at this class taken from koders.com
It provides methods for
LPICONRESOURCE ReadIconFromICOFile( LPCTSTR szFileName )
and
LPICONRESOURCE ReadIconFromEXEFile( LPCTSTR szFileName )