如何将图像作为资源包含到C ++可执行文件中? [英] How to include images as a resource into C++ executable ?

查看:69
本文介绍了如何将图像作为资源包含到C ++可执行文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将图像作为win32 c ++可执行文件中的资源包含在内?如果是这样,怎么样?



我正在使用visual studio的编译器。

Is it possible include images as resources in a win32 c++ executable? If so,how?

I am using compiler of visual studio.

推荐答案

有可能



在解决方案视图中,单击< your name => .rc文件以打开资源视图。

右单击.rc文件并选择添加资源。

现在您将打开一个对话框,其中包含位图,光标,图标等选项。



您也可以将自定义类型作为BLOB,例如嵌入式DLL。
It is possible

In your solution view, click on the <your name="">.rc file to open the resource view.
Right click on the .rc file and select "Add Resource".
Now you will open a dialog box with options for Bitmap, Cursor, Icon etc.

You can also do Custom types as a BLOB, for example an embedded DLL.


另一种可能性是使用工具bin2c。您可以使用它从二进制文件(例如.jpg .png .exe ...)生成C代码,然后可以嵌入到您的C / C ++应用程序中。



您可以在此处获取该工具: http://sourceforge.net/projects/bin2c/ [ ^ ]
Another possibility is to use the tool bin2c. You can use it to generate C-Code from binary files (e.g. .jpg .png .exe ...) which then can be embedded in your C/C++ applications.

You can get the tool here: http://sourceforge.net/projects/bin2c/[^]


这篇关于如何将图像作为资源包含到C ++可执行文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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