请参考此线程:
/forum/thread596738.html
将您的Pic文件的大小调整为0.5 x 0.5英寸。 (出于某些原因,这是必要的。)
您可以使用Microsoft Photo Editor或Photoshop进行编辑/裁剪。
这是C#代码:
this.Icon = Icon.FromHandle(new Bitmap(Bitmap.FromFile(YourFilePath_PIC))。GetHicon());
流st =新FileStream(YourFilePath_ICO,FileMode.Create);
this.Icon.Save(st);
YourFilePath_PIC就像@“ c:\ test \ myimage.bmp”
YourFIlePath_ICO就像@“ c:\ test \ myimage.ico”
希望这可以帮助,
大卫
From: /topic/net/insights/764897-convert-pic-file-jpg-bmp-etc-icon-c