开发者

accessing specific icons from a Multi-Icon (.ico) file

I would like to know if the following is possible.

I have an .ico file, containing several sizes and color depths. However, it also contains some custom made sizes, that are going to be used inside my application.

The application accesses the icon trough a resource DLL. (The intention is that the DLL is provided by a third party developer)

Is there any way to pinpoint exactly which of the icons in the .ico file to use in my application? Like I want this size to appear here on my GUI etc.

For instance, I am making a button in my application, and I would like my custom made 15*32 icon from my .ico file to be displayed on the button.

I know this is possible by adding the bitmaps one at a time to the resource DLL, giving each of them a unique name.

But it would be easier, if I am able to identify the different contents of the icon file instead.

Is it possible in some way开发者_JAVA百科 to look at the icon file as an array of icons or something like that?

Any help is much appreciated. It seems quite hard to find information about this subject on the web.

Oh, and I am writing my application in C#, using MFC DLL (from Visual C++ to create my resource DLL)


This is how I get the exact-sized image from an .ico file.

Icon myIcon = new Icon(@"C:\myIcon.ico");
Icon buttonIcon = new Icon(myIcon, 15, 32);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜