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.
Is suspect the reason for this is that the transparency is lost when I call Bitmap.FromHbitmap
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 question about IShellItemImageFactory which says that
"the API sometimes returns bitmaps that use pre-multiplied alpha and sometimes ones that use normal alpha"
Is there any way to get the icon without black background or should I just stick to Icon.ExtractAssociatedIcon
when there is no thumbnail?