700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 将Pic文件(jpg bmp等)转换为Icon c#

将Pic文件(jpg bmp等)转换为Icon c#

时间:2023-03-18 13:43:40

相关推荐

将Pic文件(jpg bmp等)转换为Icon c#

请参考此线程:

/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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。