我如何提取一个完整的图标从Vista / 7的可执行文件? [英] How Do I Extract a Full Icon From a Vista/7 Executable?
问题描述
如果我有一个Vista的.ico文件,其中包含一个16×16,32×32,256×256等版本的图标,我可以成功地通过简单地做加载它作为.NET图标 - :
If I have a Vista .ico file which contains a 16x16, 32x32, 256x256 etc. version of an icon, I can successfully load it as a .NET Icon by simply doing -:
Icon myIcon = new Icon("C:\\MyIcon.ico");
我就可以访问该图标所有不同尺寸的图像。我可以使用方法详见<一个甚至进入256x256的Vista的PNG href="http://stackoverflow.com/questions/220465/using-256-x-256-vista-icon-in-application/1945764#1945764">HERE.
不过,我还没有找到一种方式来获得全套的图标图像从Vista的可执行文件。不幸的是,这样做 - :
However, I haven't found a way to get the full set of icon images from a Vista executable. Unfortunately, doing this -:
Icon myIcon = Icon.ExtractAssociatedIcon("C:\\MyExe.exe");
...结果仅在一个单一的32×32图像被提取。有没有办法让整组图片从可执行文件作为.NET的图标? preferably一个也适用于XP。
...only results in a single 32x32 image being extracted. Is there a way get the entire set of images from an executable as a .NET Icon? Preferably one that also works in XP.
推荐答案
有一个看看这篇文章的 IconLib 在$ C $的CProject。另外,看看这个版本通过的PInvoke使用ExtractIconExAAPI在VB.NET。
Have a look at this article 'IconLib' on CodeProject. Also, look at this version using the 'ExtractIconExA' API via pinvoke in VB.NET.
希望这有助于。
这篇关于我如何提取一个完整的图标从Vista / 7的可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!