public static Icon ImageToIcon(Image image)
{
Icon icon = null;
Bitmap bitmap = new Bitmap(image);
IntPtr UnmanagedIconHandle = bitmap.GetHicon();
// Clone FromHandle result so we can destroy the unmanaged handle version of the icon before the converted object is passed out.
icon = Icon.FromHandle(UnmanagedIconHandle).Clone() as Icon;
//Unfortunately, GetHicon creates an unmanaged handle which must be manually destroyed otherwise a generic error will occur in GDI+.
DestroyIcon(UnmanagedIconHandle);
return icon;
}