Embed an application icon using WPF and F#

喜欢而已 提交于 2019-12-12 15:04:38

问题


How to embed an application icon into application.exe using WPF and F#? I did not find it anywhere.


回答1:


I think the approach is the same for WPF and WinForms, which in F# means manually!

Please see this answer.

You could also looks at FsEye's source for reference (it's done in WinForms), see line 39 of http://code.google.com/p/fseye/source/browse/tags/1.0.0-final/FsEye/FsEye.fsproj, the file http://code.google.com/p/fseye/source/browse/tags/1.0.0-final/FsEye/IconResource.fs, and line 23 of http://code.google.com/p/fseye/source/browse/tags/1.0.0-final/FsEye/Forms/WatchForm.fs




回答2:


(Update: link is no longer alive -- removed)

Quote:

"Make a .rc file with the following line: 1 ICON "icon.ico"

Then compile it with rc.exe and include the .res file in your project's properties page. You may also include .resources files in your project but the system will not pull the application icon from those."



来源:https://stackoverflow.com/questions/7500164/embed-an-application-icon-using-wpf-and-f

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!