My aim is to obtain the icons for installed programs and show these icons in WPF application. My steps are as follow:
- Get all the exe location, eg. C:\Windows\notepad.exe
- Get the Icon object, using Icon anIcon = Icon.ExtractAssociatedIcon(string)
- Convert the icon to bitmap, using anIcon.ToBitmap()
- insert bitmap in the application
But how should I do 4., the insertion?
In XAML, you have <Image Source={xxx} />
. But the source is the location of the file. So how should I insert the bitmap into the XAML?