<legend id='paG3b'><style id='paG3b'><dir id='paG3b'><q id='paG3b'></q></dir></style></legend>

<tfoot id='paG3b'></tfoot>

    • <bdo id='paG3b'></bdo><ul id='paG3b'></ul>
      1. <small id='paG3b'></small><noframes id='paG3b'>

      2. <i id='paG3b'><tr id='paG3b'><dt id='paG3b'><q id='paG3b'><span id='paG3b'><b id='paG3b'><form id='paG3b'><ins id='paG3b'></ins><ul id='paG3b'></ul><sub id='paG3b'></sub></form><legend id='paG3b'></legend><bdo id='paG3b'><pre id='paG3b'><center id='paG3b'></center></pre></bdo></b><th id='paG3b'></th></span></q></dt></tr></i><div id='paG3b'><tfoot id='paG3b'></tfoot><dl id='paG3b'><fieldset id='paG3b'></fieldset></dl></div>

        在代码中嵌入图像,不使用资源部分或外部图像

        Embed image in code, without using resource section or external images(在代码中嵌入图像,不使用资源部分或外部图像)

        <tfoot id='fm9Xg'></tfoot>

          <bdo id='fm9Xg'></bdo><ul id='fm9Xg'></ul>

        • <i id='fm9Xg'><tr id='fm9Xg'><dt id='fm9Xg'><q id='fm9Xg'><span id='fm9Xg'><b id='fm9Xg'><form id='fm9Xg'><ins id='fm9Xg'></ins><ul id='fm9Xg'></ul><sub id='fm9Xg'></sub></form><legend id='fm9Xg'></legend><bdo id='fm9Xg'><pre id='fm9Xg'><center id='fm9Xg'></center></pre></bdo></b><th id='fm9Xg'></th></span></q></dt></tr></i><div id='fm9Xg'><tfoot id='fm9Xg'></tfoot><dl id='fm9Xg'><fieldset id='fm9Xg'></fieldset></dl></div>
          <legend id='fm9Xg'><style id='fm9Xg'><dir id='fm9Xg'><q id='fm9Xg'></q></dir></style></legend>

                <tbody id='fm9Xg'></tbody>

                • <small id='fm9Xg'></small><noframes id='fm9Xg'>

                  本文介绍了在代码中嵌入图像,不使用资源部分或外部图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找一种在库中嵌入图像的方法(仅限 Windows).我不想走传统"的方式把它放在资源中(因为特殊情况使得乱七八糟的资源句柄不太方便.

                  I'm looking for a way to embed an image in a library (Windows-only). I don't want to go the 'traditional' way of putting it in the resources (because of special circumstances that make it not so convenient to mess around with the resource handle.

                  理想情况下,会有类似 xpm 文件的内容:图像的文本"表示,放入 ac 数组中,某些代码在内存中转换为位图,然后可以以某种方式将其加载到 HIMAGE 或 HICON.我要嵌入的图像是 32 位位图 (bmp).有任何想法吗?我正在使用 MFC,所以 MFC 库会很好,但当然我也可以使用不使用 MFC 的库.谢谢.

                  Ideally, there would be something like xpm files: a 'text' representation of an image that is put in a c array and that some code converts into a bitmap in memory, which can then somehow be loaded into an HIMAGE or an HICON. The images I want to embed are 32-bit bitmaps (bmp). Any ideas? I'm using MFC so an MFC library would be fine, but of course I can use a library that doesn't use MFC too. Thanks.

                  推荐答案

                  Google 的 bin2c 实用程序(类似于 http://stud3.tuwien.ac.at/~e0025274/bin2c/bin2c.c).它接受一个文件的二进制表示,并输出一个 C 源文件,其中包含一个初始化为该数据的字节数组.

                  Google for a bin2c utility (something like http://stud3.tuwien.ac.at/~e0025274/bin2c/bin2c.c). It takes a file's binary representation and spits out a C source file that includes an array of bytes initialized to that data.

                  只需将文件链接进去,您的图像就会保存在一块内存中.

                  Just link the file in and you have your image sitting in a chunk of memory.

                  在可能不存在诸如资源"甚至文件之类的东西的嵌入式系统中,使用这种工具非常普遍.

                  Using this kind of tool is really common on embedded systems where such things as 'resources' and even files might not exist.

                  这篇关于在代码中嵌入图像,不使用资源部分或外部图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
                  Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
                  STL BigInt class implementation(STL BigInt 类实现)
                  Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
                  Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
                  Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)

                  • <small id='qd1jS'></small><noframes id='qd1jS'>

                  • <i id='qd1jS'><tr id='qd1jS'><dt id='qd1jS'><q id='qd1jS'><span id='qd1jS'><b id='qd1jS'><form id='qd1jS'><ins id='qd1jS'></ins><ul id='qd1jS'></ul><sub id='qd1jS'></sub></form><legend id='qd1jS'></legend><bdo id='qd1jS'><pre id='qd1jS'><center id='qd1jS'></center></pre></bdo></b><th id='qd1jS'></th></span></q></dt></tr></i><div id='qd1jS'><tfoot id='qd1jS'></tfoot><dl id='qd1jS'><fieldset id='qd1jS'></fieldset></dl></div>

                        <tfoot id='qd1jS'></tfoot>
                          <bdo id='qd1jS'></bdo><ul id='qd1jS'></ul>
                              <tbody id='qd1jS'></tbody>
                            <legend id='qd1jS'><style id='qd1jS'><dir id='qd1jS'><q id='qd1jS'></q></dir></style></legend>