我在VC里做了一个图标(48*48, 256 color),想把它加到一个button上,但却显示不出来,我换了一个标准图标(32*32),就可以显示了。这是怎么回事?

解决方案 »

  1.   

    装载图标时换用LoadImage试一试。以下摘自LoadIcon的备注:
    LoadIcon can only load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric values. Use the LoadImage function to load icons of other sizes.
      

  2.   

    以下摘自GetSystemMetrics函数的说明:
    SM_CXICON, SM_CYICON The default width and height, in pixels, of an icon. These values are typically 32x32, but can vary depending on the installed display hardware.The LoadIcon function can only load icons of these dimensions.