如何使用exe文件附加资源(例如图像)? [英] How to attach a resource (an image for example) with the exe file?

查看:35
本文介绍了如何使用exe文件附加资源(例如图像)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我问的对不对,但是基本上发生了什么事,我做了一个Winform应用程序,它从资源文件夹中加载了它的图像.

I don't know if I asked it right, but basically what happened is that I made a winform app which loads its image from the resource folder.

问题是,当我构建项目并获取exe并将其交给朋友时,他不会像我一样拥有该资源文件夹,因此他会得到一条错误消息,提示丢失文件.

The problem is that when I build the project and get the exe and give it to a friend, he won't have that resource folder like I do, so he'll get an error saying missing file.

如何以某种方式将图像与应用程序混合,合并或附加?

How can I somehow mix, or combine, or attach the image with my app?

推荐答案

您需要通过导航到属性"窗口并转到资源"选项卡并从此处添加图像来将其添加到项目中.

You need to add it to the project by navigating to the Properties Window and going to the resource tab and adding the image from there.

或者,从PictureBox控件中,您可以从计算机导入资源.

Alternatively, from the PictureBox Control you can import resource from your computer.

这篇关于如何使用exe文件附加资源(例如图像)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆