如何创建一个包含多种尺寸/图片在C#中的图标文件

如何创建一个包含多种尺寸/图片在C#中的图标文件

问题描述:

我如何创建一个包含多种尺寸的图标文件?

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

我知道我创建一个使用从位图图标 Icon.FromHandle()但我怎么另一个图像/尺寸添加到该图标?

I know that I create a icon from a bitmap using Icon.FromHandle() but how do I add another image / size to that icon?

编辑:我需要做这在我的应用程序,所以我不能执行外部应用程序做结合

I need to do this in my application, so I cannot execute an external application to do the combining.

快速CYA:我只是做了谷歌搜索,并没有测试过下面的方法。情况因人而异。

Quick CYA: I just did a Google search, and have not tested the method below. YMMV.

我发现这篇文章,其中提到的一类做这个(尽管在VB.Net,但很容易的翻译),并告诉他如何使用它。虽然页面不再出现线程点,使源$ C ​​$ C提到的,我没有找到一个版本,它的这里

I found this article, which mentions a class that does this (albeit in VB.Net, but easy enough to translate), and tells how he used it. While the page that the thread points to no longer appears to have the source code mentioned, I did find a version of it here.