Menge
Well-known member
hi guys!
im posting here because i really couldnt find anywhere else on the net a way to create a bitmap from a 32bit icon.
no matter what i do i ALWAYS get a icon with a black border (if it uses alpha)
heres what im doing.
and no matter what i do, it just saturates the alpha channel as if it were 1-bit. All i need is just a bitmap of the icon. nothing more.
can anyone please help?
im posting here because i really couldnt find anywhere else on the net a way to create a bitmap from a 32bit icon.
no matter what i do i ALWAYS get a icon with a black border (if it uses alpha)
heres what im doing.
Code:
DockTypes.SHFileInfo FileInfo=new DockTypes.SHFileInfo();
SHGetFileInfo(ItemPath, 0, ref FileInfo, (uint)System.Runtime.InteropServices.Marshal.SizeOf(FileInfo), 0x200 | 0x100 | 0x0);
Icon ItemIcon=Icon.FromHandle(FileInfo.hIcon);
Bitmap IconBitmap=ItemIcon.ToBitmap();
and no matter what i do, it just saturates the alpha channel as if it were 1-bit. All i need is just a bitmap of the icon. nothing more.
can anyone please help?