accessing specific icons from a Multi-Icon (.ico) file
Posted
by Sagi1981
on Stack Overflow
See other posts from Stack Overflow
or by Sagi1981
Published on 2010-01-14T17:00:16Z
Indexed on
2010/04/23
13:03 UTC
Read the original article
Hit count: 191
Dear community.
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 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)
© Stack Overflow or respective owner