Icon files (*.ico) may contain multiple images at different sizes and of different colour depths.
How can I obtain a System.Drawing.Image
object from a .ico
file?
One option is Image.FromFile(...)
, but for icon files with multiple images there is no way to specify which image size and colour depth to return.
Ideally the solution would use only managed code, but I'm happy to hear about interop calls to Win32 functions as well.