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