System.Drawing.Icon icon = System.Drawing.Icon.ExtractAssociatedIcon(str_ExePath);
System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(
                                icon.Handle,
                                new Int32Rect(0, 0, icon.Width, icon.Height),
                                System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());

返回类型 System.Windows.Media.Imaging.BitmapSource

转载于:https://www.cnblogs.com/RedSky/p/7081487.html

更多推荐