C#.net 中将位图文件转换成为Icon的简单方法

调用Icon的FromHandle()方法即可
Bitmap curBitmap = new Bitmap("myfile.gif");
Icon curIcon;
curIcon = Icon.FromHandle(curBitmap.GetHicon());
this.Icon = curIcon;//可以将本表单的图标换为当前图标
posted @ 2005-09-04 22:29  MichaeL  阅读(679)  评论(0编辑  收藏  举报