How to create an Icon file that contains Multiple Sizes / Images in C#

后端 未结 5 937
悲&欢浪女
悲&欢浪女 2021-01-05 12:28

How do I create an icon file that contains multiple sizes?

I know that I create a icon from a bitmap using Icon.FromHandle() but how do I add another im

5条回答
  •  無奈伤痛
    2021-01-05 12:53

    You can't create an icon using the System.Drawing APIs. They were built for accessing specific icons from within an icon file, but not for writing back multiple icons to an .ico file.

    If you are just wanting to make icons, you could use GIMP or another image processing program to create your .ico files. Otherwise if you really need to make the .ico files programatically, you could use png2ico (invoking using System.Diagnostics.Process.Start) or something similar.

提交回复
热议问题