是否可以将图像编译成DLL或EXE文件? [英] Is it possible to compile an image into a DLL or EXE file?

查看:93
本文介绍了是否可以将图像编译成DLL或EXE文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我创建的DLL,它包含我硬盘上的图像文件,当我在另一个程序中使用该DLL时,它抱怨它无法找到它。而不是将文件移动到我正在使用DLL的程序目录,是否可以将图像直接编译到DLL或EXE中)?



甚至可以吗?







我是否总是要将图像保存在我用程序打包的某个本地目录中?

I have a DLL that I created, that contains an image file on my hard drive and when I go to use that DLL in another program it complains that it can't find it. Instead of moving the file to the programs directory where I'm using the DLL, is it possible to compile the image right into the DLL or EXE for that matter)?

Is that even possible ?

OR

Do I always have to keep an image in some local directory that I package up with the program?

推荐答案

你已经被告知有可能以及如何在以前的帖子中嵌入资源如何将图像作为资源包含在C ++可执行文件中? [ ^ ]



嵌入图像后,您无需将图像作为好吧 - 重点是它们已被嵌入! 有用的MSDN文章 [ ^ ]



问题更可能是你试图访问图像的方式 - 看看这篇文章从Managed C ++中加载带有LoadResource的DLL的JPEG图像 [ ^ ]
You have already been told that it is possible and how to embed the resource on your previous post How to include images as a resource into C++ executable ?[^]

Once you have embedded the images you do not need to ship the images as well - the whole point is that they have been embedded! Useful MSDN article[^]

The problem is more likely the way you are trying to access the images - have a look at this article Load JPEG images from DLL with LoadResource in Managed C++[^]


这篇关于是否可以将图像编译成DLL或EXE文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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