如何将BitmapImage转换为Icon?

时间:2012-06-28 15:05:02

标签: c# bitmapimage

在我的应用程序中,我必须向WCF中的shell扩展发送List<MenuItem>。这些MenuItem由图标和标签组成。图标的类型为System.Drawing.Icon,但我必须使用System.Windows.Media.Imaging.BitmapImage。 有没有办法将BitmapImage转换为Icon

2 个答案:

答案 0 :(得分:5)

我的想法:

首先将BitmapImage转换为Bitmap

Converting BitmapImage to Bitmap and vice versa

然后另存为图标

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

希望这有帮助!

答案 1 :(得分:0)

没有以这种方式自己创建图标,但也许你可以从图形到图标中受益。然后你可以选择插值模式(也许可能很好)。请在此处查看示例:http://www.dreamincode.net/code/snippet1684.htm

相关问题