While you are developing for windows, you may occasionally have to deal with problems related to old implementations.

In the past, developers made large use of .ico files and sometimes a .ico file contained a set of icons.

If you have to face front this problem, don't worry! There is a C# class to make you happy!.

As defined by Microsoft, IconBitmapDecoder Class defines a specialized decoder for icon (.ico) encoded images.

Imagine you have a .ico files containing 10 icons, and you want to get the image number 6. With a few lines of code you'll solve your problem


Looping inside images

To loop inside the images (and put them in a wrappanel) you can use the foreach statement, like the following: