Search code examples
c#bitmapimage

How can I convert BitmapImage to Icon?


In my application I have to send a List<MenuItem> to my shell extension in WCF. These MenuItems are composed of an icon and a label. The type of the icon is System.Drawing.Icon but I have to work from System.Windows.Media.Imaging.BitmapImage. Is there a way to convert BitmapImage to Icon ?


Solution

  • My thoughts:

    First convert your BitmapImage to a Bitmap

    Converting BitmapImage to Bitmap and vice versa

    then save as an Icon file

    http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/4a10d440-707f-48d7-865b-1d8804faf649/

    Hope this helps!