title: Extracting thumbnail and icon from file in c#
body: <p>I'm trying to extract thumbnail or icon if the thumbnail is not available from a file or folder like windows explorer. I'm using IShellItemImageFactory and when the thumbnail is present it works nicely. However, if the file does not have a thumbnail the icon returned by the method has a black background.</p>
  
  <p>Is suspect the reason for this is that the transparency is lost when I call <code>Bitmap.FromHbitmap</code> to convert the hbitmap to bitmap. Is it possible to convert without losing the transparency? I'm not even sure if that's the problem or not. The only reference that I could find is a comment to <a href="https://stackoverflow.com/questions/1939586/is-the-ishellitemimagefactory-interface-used-for-getting-vista-7-shell-thumbnail">question about IShellItemImageFactory</a> which says that </p>
  
  <blockquote>
    <p>"the API sometimes returns bitmaps
    that use pre-multiplied alpha and
    sometimes ones that use normal alpha"</p>
  </blockquote>
  
  <p>Is there any way to get the icon without black background or should I just stick to <code>Icon.ExtractAssociatedIcon</code> when there is no thumbnail?</p>