How to load a Windows icon using a pixel buffer?

后端 未结 2 885
清歌不尽
清歌不尽 2020-12-20 08:25

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

相关标签:
2条回答
  • 2020-12-20 08:47

    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 HBITMAPs, you can use CreateIconIndirect. Using this API, you can can even create icons with an alpha channel if you so desire.

    0 讨论(0)
  • 2020-12-20 09:03

    Take a look at this class taken from koders.com

    It provides methods for

    LPICONRESOURCE ReadIconFromICOFile( LPCTSTR szFileName )
    

    and

    LPICONRESOURCE ReadIconFromEXEFile( LPCTSTR szFileName )
    
    0 讨论(0)
提交回复
热议问题