我怎么可以转换System.Drawing.Icon到System.Drawing.Image对象? [英] how can I convert System.Drawing.Icon to System.Drawing.Image?
本文介绍了我怎么可以转换System.Drawing.Icon到System.Drawing.Image对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从另一个应用程序使用此获得的图标:
I'm getting icon from another application using this:
Icon IEIcon = Icon.ExtractAssociatedIcon(@"C:\Program Files\Internet Explorer\iexplore.exe");
如何将其转化为 System.Drawing.Image对象?
在此先感谢。
推荐答案
在位图
是图片来源
所以你可以用图标的 .ToBitmap()
方法。
Description
The Bitmap
is derived from Image
so you can use Icon's .ToBitmap()
method.
Icon IEIcon = Icon.ExtractAssociatedIcon(@"C:\Program Files\Internet Explorer\iexplore.exe");
Image im = IEIcon.ToBitmap();
更多信息
- MSDN - Bitmap类
- MSDN - 图片类
- MSDN - Bitmap Class
- MSDN - Image Class
More Information
这篇关于我怎么可以转换System.Drawing.Icon到System.Drawing.Image对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文