1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/qembed.doc:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QEmbed - File and Image Embedder</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QEmbed - File and Image Embedder</h1>
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | <p> The QEmbed tool, found in <tt>qt/tools/qembed</tt>, converts arbitrary files
|
---|
37 | into C++ code. This is useful for including image files and other resources
|
---|
38 | directly into your application rather than loading the data from external
|
---|
39 | files.
|
---|
40 | <p> QEmbed can also generate uncompressed versions of images that can be included
|
---|
41 | directly into your application, thus avoiding both the external file and the
|
---|
42 | need to parse the image file format. This is useful for small images such as
|
---|
43 | icons for which compression is not a great gain.
|
---|
44 | <p> <h2> Usage
|
---|
45 | </h2>
|
---|
46 | <a name="1"></a><p> <pre>
|
---|
47 | qembed [ general-files ] [ --images image-files ]
|
---|
48 | </pre>
|
---|
49 |
|
---|
50 | <p> <ul>
|
---|
51 | <li> <tt>general-files</tt>
|
---|
52 | <p> These files can be any type of file.
|
---|
53 | <p> <li> <tt>--images image-files</tt>
|
---|
54 | <p> These files must be in image formats supported by Qt.
|
---|
55 | </ul>
|
---|
56 | <p> <h2> Output
|
---|
57 | </h2>
|
---|
58 | <a name="2"></a><p> The output from QEmbed is a C++ header file which you should
|
---|
59 | include in a C++ source file. In the source file, you should make a
|
---|
60 | wrapper function that suits your application. Two functions are
|
---|
61 | provided; your wrapper function could just call one of these, or
|
---|
62 | you can implement your own. Here's a simple example of usage for each
|
---|
63 | of the supplied functions:
|
---|
64 | <p> <h3> qembed_findImage()
|
---|
65 | </h3>
|
---|
66 | <a name="2-1"></a><p> <pre>
|
---|
67 | #include "generated_qembed_file.h"
|
---|
68 |
|
---|
69 | <a href="qimage.html">QImage</a> myFindImage(const char* name)
|
---|
70 | {
|
---|
71 | return qembed_findImage(name);
|
---|
72 | }
|
---|
73 | </pre>
|
---|
74 |
|
---|
75 | <p> Just call the generated function; <em>name</em> is the original image
|
---|
76 | filename <b>without</b> the extension.
|
---|
77 | <p> <h3> qembed_findData()
|
---|
78 | </h3>
|
---|
79 | <a name="2-2"></a><p> <pre>
|
---|
80 | #include "generated_qembed_file.h"
|
---|
81 |
|
---|
82 | <a href="qbytearray.html">QByteArray</a> myFindData(const char* name)
|
---|
83 | {
|
---|
84 | return qembed_findData(name);
|
---|
85 | }
|
---|
86 | </pre>
|
---|
87 |
|
---|
88 | <p> Just call the generated function; <em>name</em> is the original filename
|
---|
89 | <b>with</b> the extension
|
---|
90 | <p> Alternatively, look at the output from QEmbed and write a function
|
---|
91 | tailored to your needs.
|
---|
92 |
|
---|
93 | <!-- eof -->
|
---|
94 | <p><address><hr><div align=center>
|
---|
95 | <table width=100% cellspacing=0 border=0><tr>
|
---|
96 | <td>Copyright © 2007
|
---|
97 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
98 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
99 | </table></div></address></body>
|
---|
100 | </html>
|
---|