Embedding icon in .exe with py2exe, visible in Vista?

后端 未结 4 1554
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 23:55

I\'ve been trying to embed an icon (.ico) into my \"compyled\" .exe with py2exe.

Py2Exe does have a way to embed an icon:

windows=[{
    \'script\':\'MyS         


        
4条回答
  •  既然无缘
    2021-01-31 00:33

    Vista uses icons of high resolution 256x256 pixels images, they are stored using PNG-based compression. The problem is if you simply make the icon and save it in standard XP ICO format, the resulting file will be 400Kb on disk. The solution is to compress the images. The compression scheme used is PNG (Portable Network Graphic) because it has a good lossless ratio and supports alpha channel.

    And use

    png2ico myicon.ico logo16x16.png logo32x32.png logo255x255.png
    

    It creates an ICO file from 1 or more PNG's and handles multiple sizes etc. And I guess XP would have no problem with that.

提交回复
热议问题