views:

322

answers:

1

Microsoft deploys free Image Library with Visual Studio.

At following location, you can find .png files which contain more than one icon in it.

c:\Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\1033\VS2008ImageLibrary_Common Elements\Actions\

Is there any way to access particular icon from file programmaticaly, or I have to edit those files in some photo-tool and save every icon separately ?


Edit:

  • .png files don't have more than one logical icon in it (.ico files can have)
  • .png icons shipped with VS Image library don't follow any kind of pattern so thay can not be easily utilised by code (mipmapping). They will have to be edited in some graphic tool and then saved to separated files
+2  A: 

Icon files (can) contains several images inside of them but you don't need to extract them.
The idea is that at runtime the best icon is severed (like mipmaping in 3d).
If you use the Graphics.DrawIcon(Icon, Rectangle) then the best icon will be choose for you.

or you can use Paint.NET with the Icon addin to extract the exact size.

Shay Erlichmen