简体   繁体   English

导入的图标vs资源图标

[英]Imported icon vs resource icon

What is the difference between importing icon images directly to the control, or include them as resources, in a Windows Form application? 在Windows Form应用程序中将图标图像直接导入到控件中或将其作为资源包括在内有什么区别? What are the advantages of each approach? 每种方法的优点是什么?

If you put icon directly to control, then icon will be saved directly to .resx file of form. 如果直接将图标放在控件中,则图标将直接保存到窗体的.resx文件中。

If you using icon from Resource then control using only reference to resource. 如果您使用“资源”中的图标,则只能使用对资源的引用进行控制。 if you using same icon directly to control N times, then size of file of form(yourform.resx) will be more then you use only reference to same icon from resource 如果直接使用同一图标来控制N次,则form(yourform.resx)文件的大小将更大,那么您将仅使用对资源中同一图标的引用

Embedded 嵌入式的

File saved directly to yourProject.resx file. 文件直接保存到yourProject.resx文件。

External 外部

File added to project folder and .resx file keep only a path to the file 添加到项目文件夹中的文件和.resx文件仅保留该文件的路径

MSDN Adding and Editing Resources MSDN添加和编辑资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM