[190] | 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/src/kernel/qimage.cpp:69 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QImage Class</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>QImage Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QImage class provides a hardware-independent pixmap
|
---|
| 35 | representation with direct access to the pixel data.
|
---|
| 36 | <a href="#details">More...</a>
|
---|
| 37 | <p><tt>#include <<a href="qimage-h.html">qimage.h</a>></tt>
|
---|
| 38 | <p><a href="qimage-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn>enum <a href="#Endian-enum"><b>Endian</b></a> { IgnoreEndian, BigEndian, LittleEndian }</li>
|
---|
| 42 | <li class=fn><a href="#QImage"><b>QImage</b></a> ()</li>
|
---|
| 43 | <li class=fn><a href="#QImage-2"><b>QImage</b></a> ( int w, int h, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian )</li>
|
---|
| 44 | <li class=fn><a href="#QImage-3"><b>QImage</b></a> ( const QSize & size, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian )</li>
|
---|
| 45 | <li class=fn><a href="#QImage-4"><b>QImage</b></a> ( const QString & fileName, const char * format = 0 )</li>
|
---|
| 46 | <li class=fn><a href="#QImage-5"><b>QImage</b></a> ( const char * const xpm[] )</li>
|
---|
| 47 | <li class=fn><a href="#QImage-6"><b>QImage</b></a> ( const QByteArray & array )</li>
|
---|
| 48 | <li class=fn><a href="#QImage-7"><b>QImage</b></a> ( uchar * yourdata, int w, int h, int depth, QRgb * colortable, int numColors, Endian bitOrder )</li>
|
---|
| 49 | <li class=fn><a href="#QImage-8"><b>QImage</b></a> ( uchar * yourdata, int w, int h, int depth, int bpl, QRgb * colortable, int numColors, Endian bitOrder )</li>
|
---|
| 50 | <li class=fn><a href="#QImage-9"><b>QImage</b></a> ( const QImage & image )</li>
|
---|
| 51 | <li class=fn><a href="#~QImage"><b>~QImage</b></a> ()</li>
|
---|
| 52 | <li class=fn>QImage & <a href="#operator-eq"><b>operator=</b></a> ( const QImage & image )</li>
|
---|
| 53 | <li class=fn>QImage & <a href="#operator-eq-2"><b>operator=</b></a> ( const QPixmap & pixmap )</li>
|
---|
| 54 | <li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QImage & i ) const</li>
|
---|
| 55 | <li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const QImage & i ) const</li>
|
---|
| 56 | <li class=fn>void <a href="#detach"><b>detach</b></a> ()</li>
|
---|
| 57 | <li class=fn>QImage <a href="#copy"><b>copy</b></a> () const</li>
|
---|
| 58 | <li class=fn>QImage <a href="#copy-2"><b>copy</b></a> ( int x, int y, int w, int h, int conversion_flags = 0 ) const</li>
|
---|
| 59 | <li class=fn>QImage <a href="#copy-3"><b>copy</b></a> ( const QRect & r ) const</li>
|
---|
| 60 | <li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
|
---|
| 61 | <li class=fn>int <a href="#width"><b>width</b></a> () const</li>
|
---|
| 62 | <li class=fn>int <a href="#height"><b>height</b></a> () const</li>
|
---|
| 63 | <li class=fn>QSize <a href="#size"><b>size</b></a> () const</li>
|
---|
| 64 | <li class=fn>QRect <a href="#rect"><b>rect</b></a> () const</li>
|
---|
| 65 | <li class=fn>int <a href="#depth"><b>depth</b></a> () const</li>
|
---|
| 66 | <li class=fn>int <a href="#numColors"><b>numColors</b></a> () const</li>
|
---|
| 67 | <li class=fn>Endian <a href="#bitOrder"><b>bitOrder</b></a> () const</li>
|
---|
| 68 | <li class=fn>QRgb <a href="#color"><b>color</b></a> ( int i ) const</li>
|
---|
| 69 | <li class=fn>void <a href="#setColor"><b>setColor</b></a> ( int i, QRgb c )</li>
|
---|
| 70 | <li class=fn>void <a href="#setNumColors"><b>setNumColors</b></a> ( int numColors )</li>
|
---|
| 71 | <li class=fn>bool <a href="#hasAlphaBuffer"><b>hasAlphaBuffer</b></a> () const</li>
|
---|
| 72 | <li class=fn>void <a href="#setAlphaBuffer"><b>setAlphaBuffer</b></a> ( bool enable )</li>
|
---|
| 73 | <li class=fn>bool <a href="#allGray"><b>allGray</b></a> () const</li>
|
---|
| 74 | <li class=fn>bool <a href="#isGrayscale"><b>isGrayscale</b></a> () const</li>
|
---|
| 75 | <li class=fn>uchar * <a href="#bits"><b>bits</b></a> () const</li>
|
---|
| 76 | <li class=fn>uchar * <a href="#scanLine"><b>scanLine</b></a> ( int i ) const</li>
|
---|
| 77 | <li class=fn>uchar ** <a href="#jumpTable"><b>jumpTable</b></a> () const</li>
|
---|
| 78 | <li class=fn>QRgb * <a href="#colorTable"><b>colorTable</b></a> () const</li>
|
---|
| 79 | <li class=fn>int <a href="#numBytes"><b>numBytes</b></a> () const</li>
|
---|
| 80 | <li class=fn>int <a href="#bytesPerLine"><b>bytesPerLine</b></a> () const</li>
|
---|
| 81 | <li class=fn>bool <a href="#create"><b>create</b></a> ( int width, int height, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian )</li>
|
---|
| 82 | <li class=fn>bool <a href="#create-2"><b>create</b></a> ( const QSize &, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian )</li>
|
---|
| 83 | <li class=fn>void <a href="#reset"><b>reset</b></a> ()</li>
|
---|
| 84 | <li class=fn>void <a href="#fill"><b>fill</b></a> ( uint pixel )</li>
|
---|
| 85 | <li class=fn>void <a href="#invertPixels"><b>invertPixels</b></a> ( bool invertAlpha = TRUE )</li>
|
---|
| 86 | <li class=fn>QImage <a href="#convertDepth-2"><b>convertDepth</b></a> ( int depth ) const</li>
|
---|
| 87 | <li class=fn>QImage <a href="#convertDepthWithPalette"><b>convertDepthWithPalette</b></a> ( int d, QRgb * palette, int palette_count, int conversion_flags = 0 ) const</li>
|
---|
| 88 | <li class=fn>QImage <a href="#convertDepth"><b>convertDepth</b></a> ( int depth, int conversion_flags ) const</li>
|
---|
| 89 | <li class=fn>QImage <a href="#convertBitOrder"><b>convertBitOrder</b></a> ( Endian bitOrder ) const</li>
|
---|
| 90 | <li class=fn>enum <a href="#ScaleMode-enum"><b>ScaleMode</b></a> { ScaleFree, ScaleMin, ScaleMax }</li>
|
---|
| 91 | <li class=fn>QImage <a href="#smoothScale"><b>smoothScale</b></a> ( int w, int h, ScaleMode mode = ScaleFree ) const</li>
|
---|
| 92 | <li class=fn>QImage <a href="#smoothScale-2"><b>smoothScale</b></a> ( const QSize & s, ScaleMode mode = ScaleFree ) const</li>
|
---|
| 93 | <li class=fn>QImage <a href="#scale"><b>scale</b></a> ( int w, int h, ScaleMode mode = ScaleFree ) const</li>
|
---|
| 94 | <li class=fn>QImage <a href="#scale-2"><b>scale</b></a> ( const QSize & s, ScaleMode mode = ScaleFree ) const</li>
|
---|
| 95 | <li class=fn>QImage <a href="#scaleWidth"><b>scaleWidth</b></a> ( int w ) const</li>
|
---|
| 96 | <li class=fn>QImage <a href="#scaleHeight"><b>scaleHeight</b></a> ( int h ) const</li>
|
---|
| 97 | <li class=fn>QImage <a href="#xForm"><b>xForm</b></a> ( const QWMatrix & matrix ) const</li>
|
---|
| 98 | <li class=fn>QImage <a href="#createAlphaMask"><b>createAlphaMask</b></a> ( int conversion_flags = 0 ) const</li>
|
---|
| 99 | <li class=fn>QImage <a href="#createHeuristicMask"><b>createHeuristicMask</b></a> ( bool clipTight = TRUE ) const</li>
|
---|
| 100 | <li class=fn>QImage <a href="#mirror"><b>mirror</b></a> () const</li>
|
---|
| 101 | <li class=fn>QImage <a href="#mirror-2"><b>mirror</b></a> ( bool horizontal, bool vertical ) const</li>
|
---|
| 102 | <li class=fn>QImage <a href="#swapRGB"><b>swapRGB</b></a> () const</li>
|
---|
| 103 | <li class=fn>bool <a href="#load"><b>load</b></a> ( const QString & fileName, const char * format = 0 )</li>
|
---|
| 104 | <li class=fn>bool <a href="#loadFromData"><b>loadFromData</b></a> ( const uchar * buf, uint len, const char * format = 0 )</li>
|
---|
| 105 | <li class=fn>bool <a href="#loadFromData-2"><b>loadFromData</b></a> ( QByteArray buf, const char * format = 0 )</li>
|
---|
| 106 | <li class=fn>bool <a href="#save"><b>save</b></a> ( const QString & fileName, const char * format, int quality = -1 ) const</li>
|
---|
| 107 | <li class=fn>bool <a href="#save-2"><b>save</b></a> ( QIODevice * device, const char * format, int quality = -1 ) const</li>
|
---|
| 108 | <li class=fn>bool <a href="#valid"><b>valid</b></a> ( int x, int y ) const</li>
|
---|
| 109 | <li class=fn>int <a href="#pixelIndex"><b>pixelIndex</b></a> ( int x, int y ) const</li>
|
---|
| 110 | <li class=fn>QRgb <a href="#pixel"><b>pixel</b></a> ( int x, int y ) const</li>
|
---|
| 111 | <li class=fn>void <a href="#setPixel"><b>setPixel</b></a> ( int x, int y, uint index_or_rgb )</li>
|
---|
| 112 | <li class=fn>int <a href="#dotsPerMeterX"><b>dotsPerMeterX</b></a> () const</li>
|
---|
| 113 | <li class=fn>int <a href="#dotsPerMeterY"><b>dotsPerMeterY</b></a> () const</li>
|
---|
| 114 | <li class=fn>void <a href="#setDotsPerMeterX"><b>setDotsPerMeterX</b></a> ( int x )</li>
|
---|
| 115 | <li class=fn>void <a href="#setDotsPerMeterY"><b>setDotsPerMeterY</b></a> ( int y )</li>
|
---|
| 116 | <li class=fn>QPoint <a href="#offset"><b>offset</b></a> () const</li>
|
---|
| 117 | <li class=fn>void <a href="#setOffset"><b>setOffset</b></a> ( const QPoint & p )</li>
|
---|
| 118 | <li class=fn>QValueList<QImageTextKeyLang> <a href="#textList"><b>textList</b></a> () const</li>
|
---|
| 119 | <li class=fn>QStringList <a href="#textLanguages"><b>textLanguages</b></a> () const</li>
|
---|
| 120 | <li class=fn>QStringList <a href="#textKeys"><b>textKeys</b></a> () const</li>
|
---|
| 121 | <li class=fn>QString <a href="#text"><b>text</b></a> ( const char * key, const char * lang = 0 ) const</li>
|
---|
| 122 | <li class=fn>QString <a href="#text-2"><b>text</b></a> ( const QImageTextKeyLang & kl ) const</li>
|
---|
| 123 | <li class=fn>void <a href="#setText"><b>setText</b></a> ( const char * key, const char * lang, const QString & s )</li>
|
---|
| 124 | </ul>
|
---|
| 125 | <h2>Static Public Members</h2>
|
---|
| 126 | <ul>
|
---|
| 127 | <li class=fn>QImage <a href="#fromMimeSource"><b>fromMimeSource</b></a> ( const QString & abs_name )</li>
|
---|
| 128 | <li class=fn>Endian <a href="#systemBitOrder"><b>systemBitOrder</b></a> ()</li>
|
---|
| 129 | <li class=fn>Endian <a href="#systemByteOrder"><b>systemByteOrder</b></a> ()</li>
|
---|
| 130 | <li class=fn>const char * <a href="#imageFormat"><b>imageFormat</b></a> ( const QString & fileName )</li>
|
---|
| 131 | <li class=fn>QStrList <a href="#inputFormats"><b>inputFormats</b></a> ()</li>
|
---|
| 132 | <li class=fn>QStrList <a href="#outputFormats"><b>outputFormats</b></a> ()</li>
|
---|
| 133 | <li class=fn>QStringList <a href="#inputFormatList"><b>inputFormatList</b></a> ()</li>
|
---|
| 134 | <li class=fn>QStringList <a href="#outputFormatList"><b>outputFormatList</b></a> ()</li>
|
---|
| 135 | </ul>
|
---|
| 136 | <h2>Related Functions</h2>
|
---|
| 137 | <ul>
|
---|
| 138 | <li class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QImage & image )</li>
|
---|
| 139 | <li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QImage & image )</li>
|
---|
| 140 | <li class=fn>void <a href="#bitBlt"><b>bitBlt</b></a> ( QImage * dst, int dx, int dy, const QImage * src, int sx, int sy, int sw, int sh, int conversion_flags )</li>
|
---|
| 141 | </ul>
|
---|
| 142 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 143 |
|
---|
| 144 |
|
---|
| 145 | The QImage class provides a hardware-independent pixmap
|
---|
| 146 | representation with direct access to the pixel data.
|
---|
| 147 | <p>
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 |
|
---|
| 151 | <p> It is one of the two classes Qt provides for dealing with images,
|
---|
| 152 | the other being <a href="qpixmap.html">QPixmap</a>. QImage is designed and optimized for I/O
|
---|
| 153 | and for direct pixel access/manipulation. QPixmap is designed and
|
---|
| 154 | optimized for drawing. There are (slow) functions to convert
|
---|
| 155 | between QImage and QPixmap: <a href="qpixmap.html#convertToImage">QPixmap::convertToImage</a>() and
|
---|
| 156 | <a href="qpixmap.html#convertFromImage">QPixmap::convertFromImage</a>().
|
---|
| 157 | <p> An image has the parameters <a href="#width">width</a>, <a href="#height">height</a> and <a href="#depth">depth</a> (bits per
|
---|
| 158 | pixel, bpp), a color table and the actual <a href="#bits">pixels</a>. QImage supports 1-bpp, 8-bpp and 32-bpp image
|
---|
| 159 | data. 1-bpp and 8-bpp images use a color lookup table; the pixel
|
---|
| 160 | value is a color table index.
|
---|
| 161 | <p> 32-bpp images encode an RGB value in 24 bits and ignore the color
|
---|
| 162 | table. The most significant byte is used for the <a href="#setAlphaBuffer">alpha buffer</a>.
|
---|
| 163 | <p> An entry in the color table is an RGB triplet encoded as a <tt>uint</tt>. Use the <a href="qcolor.html#qRed">qRed()</a>, <a href="qcolor.html#qGreen">qGreen()</a> and <a href="qcolor.html#qBlue">qBlue()</a> functions (<a href="qcolor-h.html">qcolor.h</a>) to access the components, and <a href="qcolor.html#qRgb">qRgb</a> to make an RGB triplet (see the <a href="qcolor.html">QColor</a> class
|
---|
| 164 | documentation).
|
---|
| 165 | <p> 1-bpp (monochrome) images have a color table with a most two
|
---|
| 166 | colors. There are two different formats: big endian (MSB first) or
|
---|
| 167 | little endian (LSB first) bit order. To access a single bit you
|
---|
| 168 | will must do some bit shifts:
|
---|
| 169 | <p> <pre>
|
---|
| 170 | QImage image;
|
---|
| 171 | // sets bit at (x,y) to 1
|
---|
| 172 | if ( image.<a href="#bitOrder">bitOrder</a>() == QImage::<a href="#Endian-enum">LittleEndian</a> )
|
---|
| 173 | *(image.<a href="#scanLine">scanLine</a>(y) + (x >> 3)) |= 1 << (x & 7);
|
---|
| 174 | else
|
---|
| 175 | *(image.<a href="#scanLine">scanLine</a>(y) + (x >> 3)) |= 1 << (7 - (x & 7));
|
---|
| 176 | </pre>
|
---|
| 177 |
|
---|
| 178 | <p> If this looks complicated, it might be a good idea to convert the
|
---|
| 179 | 1-bpp image to an 8-bpp image using <a href="#convertDepth">convertDepth</a>().
|
---|
| 180 | <p> 8-bpp images are much easier to work with than 1-bpp images
|
---|
| 181 | because they have a single byte per pixel:
|
---|
| 182 | <p> <pre>
|
---|
| 183 | QImage image;
|
---|
| 184 | // set entry 19 in the color table to yellow
|
---|
| 185 | image.<a href="#setColor">setColor</a>( 19, qRgb(255,255,0) );
|
---|
| 186 | // set 8 bit pixel at (x,y) to value yellow (in color table)
|
---|
| 187 | *(image.<a href="#scanLine">scanLine</a>(y) + x) = 19;
|
---|
| 188 | </pre>
|
---|
| 189 |
|
---|
| 190 | <p> 32-bpp images ignore the color table; instead, each pixel contains
|
---|
| 191 | the RGB triplet. 24 bits contain the RGB value; the most
|
---|
| 192 | significant byte is reserved for the alpha buffer.
|
---|
| 193 | <p> <pre>
|
---|
| 194 | QImage image;
|
---|
| 195 | // sets 32 bit pixel at (x,y) to yellow.
|
---|
| 196 | uint *p = (uint *)image.<a href="#scanLine">scanLine</a>(y) + x;
|
---|
| 197 | *p = <a href="qcolor.html#qRgb">qRgb</a>(255,255,0);
|
---|
| 198 | </pre>
|
---|
| 199 |
|
---|
| 200 | <p> On Qt/Embedded, scanlines are aligned to the pixel depth and may
|
---|
| 201 | be padded to any degree, while on all other platforms, the
|
---|
| 202 | scanlines are 32-bit aligned for all depths. The constructor
|
---|
| 203 | taking a <tt>uchar*</tt> argument always expects 32-bit aligned data.
|
---|
| 204 | On Qt/Embedded, an additional constructor allows the number of
|
---|
| 205 | bytes-per-line to be specified.
|
---|
| 206 | <p> QImage supports a variety of methods for getting information about
|
---|
| 207 | the image, for example, <a href="#colorTable">colorTable</a>(), <a href="#allGray">allGray</a>(), <a href="#isGrayscale">isGrayscale</a>(),
|
---|
| 208 | <a href="#bitOrder">bitOrder</a>(), <a href="#bytesPerLine">bytesPerLine</a>(), <a href="#depth">depth</a>(), <a href="#dotsPerMeterX">dotsPerMeterX</a>() and
|
---|
| 209 | <a href="#dotsPerMeterY">dotsPerMeterY</a>(), <a href="#hasAlphaBuffer">hasAlphaBuffer</a>(), <a href="#numBytes">numBytes</a>(), <a href="#numColors">numColors</a>(), and
|
---|
| 210 | <a href="#width">width</a>() and <a href="#height">height</a>().
|
---|
| 211 | <p> Pixel colors are retrieved with <a href="#pixel">pixel</a>() and set with <a href="#setPixel">setPixel</a>().
|
---|
| 212 | <p> QImage also supports a number of functions for creating a new
|
---|
| 213 | image that is a transformed version of the original. For example,
|
---|
| 214 | <a href="#copy">copy</a>(), <a href="#convertBitOrder">convertBitOrder</a>(), <a href="#convertDepth">convertDepth</a>(), <a href="#createAlphaMask">createAlphaMask</a>(),
|
---|
| 215 | <a href="#createHeuristicMask">createHeuristicMask</a>(), <a href="#mirror">mirror</a>(), <a href="#scale">scale</a>(), <a href="#smoothScale">smoothScale</a>(), <a href="#swapRGB">swapRGB</a>()
|
---|
| 216 | and <a href="#xForm">xForm</a>(). There are also functions for changing attributes of
|
---|
| 217 | an image in-place, for example, <a href="#setAlphaBuffer">setAlphaBuffer</a>(), <a href="#setColor">setColor</a>(),
|
---|
| 218 | <a href="#setDotsPerMeterX">setDotsPerMeterX</a>() and <a href="#setDotsPerMeterY">setDotsPerMeterY</a>() and <a href="#setNumColors">setNumColors</a>().
|
---|
| 219 | <p> Images can be loaded and saved in the supported formats. Images
|
---|
| 220 | are saved to a file with <a href="#save">save</a>(). Images are loaded from a file
|
---|
| 221 | with <a href="#load">load</a>() (or in the constructor) or from an array of data with
|
---|
| 222 | <a href="#loadFromData">loadFromData</a>(). The lists of supported formats are available from
|
---|
| 223 | <a href="#inputFormatList">inputFormatList</a>() and <a href="#outputFormatList">outputFormatList</a>().
|
---|
| 224 | <p> Strings of text may be added to images using <a href="#setText">setText</a>().
|
---|
| 225 | <p> The QImage class uses explicit <a href="shclass.html">sharing</a>,
|
---|
| 226 | similar to that used by <a href="qmemarray.html">QMemArray</a>.
|
---|
| 227 | <p> New image formats can be added as <a href="plugins-howto.html">plugins</a>.
|
---|
| 228 | <p> <p>See also <a href="qimageio.html">QImageIO</a>, <a href="qpixmap.html">QPixmap</a>, <a href="shclass.html">Shared Classes</a>, <a href="graphics.html">Graphics Classes</a>, <a href="images.html">Image Processing Classes</a>, and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.
|
---|
| 229 |
|
---|
| 230 | <hr><h2>Member Type Documentation</h2>
|
---|
| 231 | <h3 class=fn><a name="Endian-enum"></a>QImage::Endian</h3>
|
---|
| 232 |
|
---|
| 233 | <p> This enum type is used to describe the endianness of the CPU and
|
---|
| 234 | graphics hardware.
|
---|
| 235 | <ul>
|
---|
| 236 | <li><tt>QImage::IgnoreEndian</tt> - Endianness does not matter. Useful for some
|
---|
| 237 | operations that are independent of endianness.
|
---|
| 238 | <li><tt>QImage::BigEndian</tt> - Network byte order, as on SPARC and Motorola CPUs.
|
---|
| 239 | <li><tt>QImage::LittleEndian</tt> - PC/Alpha byte order.
|
---|
| 240 | </ul>
|
---|
| 241 | <h3 class=fn><a name="ScaleMode-enum"></a>QImage::ScaleMode</h3>
|
---|
| 242 |
|
---|
| 243 | <p> The functions <a href="#scale">scale</a>() and <a href="#smoothScale">smoothScale</a>() use different modes for
|
---|
| 244 | scaling the image. The purpose of these modes is to retain the
|
---|
| 245 | ratio of the image if this is required.
|
---|
| 246 | <p> <center><img src="scaling.png"></center>
|
---|
| 247 | <ul>
|
---|
| 248 | <li><tt>QImage::ScaleFree</tt> - The image is scaled freely: the resulting image
|
---|
| 249 | fits exactly into the specified size; the ratio will not
|
---|
| 250 | necessarily be preserved.
|
---|
| 251 | <li><tt>QImage::ScaleMin</tt> - The ratio of the image is preserved and the
|
---|
| 252 | resulting image is guaranteed to fit into the specified size
|
---|
| 253 | (it is as large as possible within these constraints) - the
|
---|
| 254 | image might be smaller than the requested size.
|
---|
| 255 | <li><tt>QImage::ScaleMax</tt> - The ratio of the image is preserved and the
|
---|
| 256 | resulting image fills the whole specified rectangle (it is as
|
---|
| 257 | small as possible within these constraints) - the image might
|
---|
| 258 | be larger than the requested size.
|
---|
| 259 | </ul>
|
---|
| 260 | <hr><h2>Member Function Documentation</h2>
|
---|
| 261 | <h3 class=fn><a name="QImage"></a>QImage::QImage ()
|
---|
| 262 | </h3>
|
---|
| 263 | Constructs a null image.
|
---|
| 264 | <p> <p>See also <a href="#isNull">isNull</a>().
|
---|
| 265 |
|
---|
| 266 | <h3 class=fn><a name="QImage-2"></a>QImage::QImage ( int w, int h, int depth, int numColors = 0, <a href="qimage.html#Endian-enum">Endian</a> bitOrder = IgnoreEndian )
|
---|
| 267 | </h3>
|
---|
| 268 | Constructs an image with <em>w</em> width, <em>h</em> height, <em>depth</em> bits
|
---|
| 269 | per pixel, <em>numColors</em> colors and bit order <em>bitOrder</em>.
|
---|
| 270 | <p> Using this constructor is the same as first constructing a null
|
---|
| 271 | image and then calling the <a href="#create">create</a>() function.
|
---|
| 272 | <p> <p>See also <a href="#create">create</a>().
|
---|
| 273 |
|
---|
| 274 | <h3 class=fn><a name="QImage-3"></a>QImage::QImage ( const <a href="qsize.html">QSize</a> & size, int depth, int numColors = 0, <a href="qimage.html#Endian-enum">Endian</a> bitOrder = IgnoreEndian )
|
---|
| 275 | </h3>
|
---|
| 276 | Constructs an image with size <em>size</em> pixels, depth <em>depth</em> bits,
|
---|
| 277 | <em>numColors</em> and <em>bitOrder</em> endianness.
|
---|
| 278 | <p> Using this constructor is the same as first constructing a null
|
---|
| 279 | image and then calling the <a href="#create">create</a>() function.
|
---|
| 280 | <p> <p>See also <a href="#create">create</a>().
|
---|
| 281 |
|
---|
| 282 | <h3 class=fn><a name="QImage-4"></a>QImage::QImage ( const <a href="qstring.html">QString</a> & fileName, const char * format = 0 )
|
---|
| 283 | </h3>
|
---|
| 284 | Constructs an image and tries to load the image from the file <em>fileName</em>.
|
---|
| 285 | <p> If <em>format</em> is specified, the loader attempts to read the image
|
---|
| 286 | using the specified format. If <em>format</em> is not specified (which
|
---|
| 287 | is the default), the loader reads a few bytes from the header to
|
---|
| 288 | guess the file format.
|
---|
| 289 | <p> If the loading of the image failed, this object is a <a href="#isNull">null</a> image.
|
---|
| 290 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
|
---|
| 291 | explains how to add extra formats.
|
---|
| 292 | <p> <p>See also <a href="#load">load</a>(), <a href="#isNull">isNull</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 293 |
|
---|
| 294 | <h3 class=fn><a name="QImage-5"></a>QImage::QImage ( const char * const xpm[] )
|
---|
| 295 | </h3>
|
---|
| 296 | Constructs an image from <em>xpm</em>, which must be a valid XPM image.
|
---|
| 297 | <p> Errors are silently ignored.
|
---|
| 298 | <p> Note that it's possible to squeeze the XPM variable a little bit
|
---|
| 299 | by using an unusual declaration:
|
---|
| 300 | <p> <pre>
|
---|
| 301 | static const char * const start_xpm[]={
|
---|
| 302 | "16 15 8 1",
|
---|
| 303 | "a c #cec6bd",
|
---|
| 304 | ....
|
---|
| 305 | </pre>
|
---|
| 306 |
|
---|
| 307 | <p> The extra <tt>const</tt> makes the entire definition read-only, which is
|
---|
| 308 | slightly more efficient (e.g. when the code is in a shared
|
---|
| 309 | library) and ROMable when the application is to be stored in ROM.
|
---|
| 310 |
|
---|
| 311 | <h3 class=fn><a name="QImage-6"></a>QImage::QImage ( const <a href="qbytearray.html">QByteArray</a> & array )
|
---|
| 312 | </h3>
|
---|
| 313 | Constructs an image from the binary data <em>array</em>. It tries to
|
---|
| 314 | guess the file format.
|
---|
| 315 | <p> If the loading of the image failed, this object is a <a href="#isNull">null</a> image.
|
---|
| 316 | <p> <p>See also <a href="#loadFromData">loadFromData</a>(), <a href="#isNull">isNull</a>(), and <a href="#imageFormat">imageFormat</a>().
|
---|
| 317 |
|
---|
| 318 | <h3 class=fn><a name="QImage-7"></a>QImage::QImage ( uchar * yourdata, int w, int h, int depth, QRgb * colortable, int numColors, <a href="qimage.html#Endian-enum">Endian</a> bitOrder )
|
---|
| 319 | </h3>
|
---|
| 320 | Constructs an image <em>w</em> pixels wide, <em>h</em> pixels high with a
|
---|
| 321 | color depth of <em>depth</em>, that uses an existing memory buffer, <em>yourdata</em>. The buffer must remain valid throughout the life of the
|
---|
| 322 | QImage. The image does not delete the buffer at destruction.
|
---|
| 323 | <p> If <em>colortable</em> is 0, a color table sufficient for <em>numColors</em>
|
---|
| 324 | will be allocated (and destructed later).
|
---|
| 325 | <p> Note that <em>yourdata</em> must be 32-bit aligned.
|
---|
| 326 | <p> The endianness is given in <em>bitOrder</em>.
|
---|
| 327 |
|
---|
| 328 | <h3 class=fn><a name="QImage-8"></a>QImage::QImage ( uchar * yourdata, int w, int h, int depth, int bpl, QRgb * colortable, int numColors, <a href="qimage.html#Endian-enum">Endian</a> bitOrder )
|
---|
| 329 | </h3>
|
---|
| 330 | Constructs an image that uses an existing memory buffer. The
|
---|
| 331 | buffer must remain valid for the life of the QImage. The image
|
---|
| 332 | does not delete the buffer at destruction. The buffer is passed as
|
---|
| 333 | <em>yourdata</em>. The image's width is <em>w</em> and its height is <em>h</em>. The
|
---|
| 334 | color depth is <em>depth</em>. <em>bpl</em> specifies the number of bytes per
|
---|
| 335 | line.
|
---|
| 336 | <p> If <em>colortable</em> is 0, a color table sufficient for <em>numColors</em>
|
---|
| 337 | will be allocated (and destructed later).
|
---|
| 338 | <p> The endianness is specified by <em>bitOrder</em>.
|
---|
| 339 | <p> <b>Warning:</b> This constructor is only available on Qt/Embedded.
|
---|
| 340 |
|
---|
| 341 | <h3 class=fn><a name="QImage-9"></a>QImage::QImage ( const <a href="qimage.html">QImage</a> & image )
|
---|
| 342 | </h3>
|
---|
| 343 | Constructs a <a href="shclass.html">shallow copy</a> of <em>image</em>.
|
---|
| 344 |
|
---|
| 345 | <h3 class=fn><a name="~QImage"></a>QImage::~QImage ()
|
---|
| 346 | </h3>
|
---|
| 347 | Destroys the image and cleans up.
|
---|
| 348 |
|
---|
| 349 | <h3 class=fn>bool <a name="allGray"></a>QImage::allGray () const
|
---|
| 350 | </h3>
|
---|
| 351 | Returns TRUE if all the colors in the image are shades of gray
|
---|
| 352 | (i.e. their red, green and blue components are equal); otherwise
|
---|
| 353 | returns FALSE.
|
---|
| 354 | <p> This function is slow for large 16-bit (Qt/Embedded only) and 32-bit images.
|
---|
| 355 | <p> <p>See also <a href="#isGrayscale">isGrayscale</a>().
|
---|
| 356 |
|
---|
| 357 | <h3 class=fn><a href="qimage.html#Endian-enum">Endian</a> <a name="bitOrder"></a>QImage::bitOrder () const
|
---|
| 358 | </h3>
|
---|
| 359 |
|
---|
| 360 | <p> Returns the bit order for the image.
|
---|
| 361 | <p> If it is a 1-bpp image, this function returns either
|
---|
| 362 | QImage::BigEndian or QImage::LittleEndian.
|
---|
| 363 | <p> If it is not a 1-bpp image, this function returns
|
---|
| 364 | QImage::IgnoreEndian.
|
---|
| 365 | <p> <p>See also <a href="#depth">depth</a>().
|
---|
| 366 |
|
---|
| 367 | <h3 class=fn>uchar * <a name="bits"></a>QImage::bits () const
|
---|
| 368 | </h3>
|
---|
| 369 |
|
---|
| 370 | <p> Returns a pointer to the first pixel data. This is equivalent to
|
---|
| 371 | <a href="#scanLine">scanLine</a>(0).
|
---|
| 372 | <p> <p>See also <a href="#numBytes">numBytes</a>(), <a href="#scanLine">scanLine</a>(), and <a href="#jumpTable">jumpTable</a>().
|
---|
| 373 |
|
---|
| 374 | <p>Example: <a href="qglwidget.html#x2119">opengl/texture/gltexobj.cpp</a>.
|
---|
| 375 | <h3 class=fn>int <a name="bytesPerLine"></a>QImage::bytesPerLine () const
|
---|
| 376 | </h3>
|
---|
| 377 |
|
---|
| 378 | <p> Returns the number of bytes per image scanline. This is equivalent
|
---|
| 379 | to <a href="#numBytes">numBytes</a>()/height().
|
---|
| 380 | <p> <p>See also <a href="#numBytes">numBytes</a>() and <a href="#scanLine">scanLine</a>().
|
---|
| 381 |
|
---|
| 382 | <h3 class=fn>QRgb <a name="color"></a>QImage::color ( int i ) const
|
---|
| 383 | </h3>
|
---|
| 384 |
|
---|
| 385 | <p> Returns the color in the color table at index <em>i</em>. The first
|
---|
| 386 | color is at index 0.
|
---|
| 387 | <p> A color value is an RGB triplet. Use the <a href="qcolor.html#qRed">qRed()</a>, <a href="qcolor.html#qGreen">qGreen()</a> and <a href="qcolor.html#qBlue">qBlue()</a> functions (defined in <a href="qcolor-h.html">qcolor.h</a>) to
|
---|
| 388 | get the color value components.
|
---|
| 389 | <p> <p>See also <a href="#setColor">setColor</a>(), <a href="#numColors">numColors</a>(), and <a href="qcolor.html">QColor</a>.
|
---|
| 390 |
|
---|
| 391 | <p>Example: <a href="themes-example.html#x207">themes/wood.cpp</a>.
|
---|
| 392 | <h3 class=fn>QRgb * <a name="colorTable"></a>QImage::colorTable () const
|
---|
| 393 | </h3>
|
---|
| 394 |
|
---|
| 395 | <p> Returns a pointer to the color table.
|
---|
| 396 | <p> <p>See also <a href="#numColors">numColors</a>().
|
---|
| 397 |
|
---|
| 398 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="convertBitOrder"></a>QImage::convertBitOrder ( <a href="qimage.html#Endian-enum">Endian</a> bitOrder ) const
|
---|
| 399 | </h3>
|
---|
| 400 | Converts the bit order of the image to <em>bitOrder</em> and returns the
|
---|
| 401 | converted image. The original image is not changed.
|
---|
| 402 | <p> Returns <tt>*this</tt> if the <em>bitOrder</em> is equal to the image bit
|
---|
| 403 | order, or a <a href="#isNull">null</a> image if this image cannot
|
---|
| 404 | be converted.
|
---|
| 405 | <p> <p>See also <a href="#bitOrder">bitOrder</a>(), <a href="#systemBitOrder">systemBitOrder</a>(), and <a href="#isNull">isNull</a>().
|
---|
| 406 |
|
---|
| 407 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="convertDepth"></a>QImage::convertDepth ( int depth, int conversion_flags ) const
|
---|
| 408 | </h3>
|
---|
| 409 | Converts the depth (bpp) of the image to <em>depth</em> and returns the
|
---|
| 410 | converted image. The original image is not changed.
|
---|
| 411 | <p> The <em>depth</em> argument must be 1, 8, 16 (Qt/Embedded only) or 32.
|
---|
| 412 | <p> Returns <tt>*this</tt> if <em>depth</em> is equal to the image depth, or a
|
---|
| 413 | <a href="#isNull">null</a> image if this image cannot be
|
---|
| 414 | converted.
|
---|
| 415 | <p> If the image needs to be modified to fit in a lower-resolution
|
---|
| 416 | result (e.g. converting from 32-bit to 8-bit), use the <em>conversion_flags</em> to specify how you'd prefer this to happen.
|
---|
| 417 | <p> <p>See also <a href="qt.html#ImageConversionFlags-enum">Qt::ImageConversionFlags</a>, <a href="#depth">depth</a>(), and <a href="#isNull">isNull</a>().
|
---|
| 418 |
|
---|
| 419 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="convertDepth-2"></a>QImage::convertDepth ( int depth ) const
|
---|
| 420 | </h3>
|
---|
| 421 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 422 | <p>
|
---|
| 423 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="convertDepthWithPalette"></a>QImage::convertDepthWithPalette ( int d, QRgb * palette, int palette_count, int conversion_flags = 0 ) const
|
---|
| 424 | </h3>
|
---|
| 425 | Returns an image with depth <em>d</em>, using the <em>palette_count</em>
|
---|
| 426 | colors pointed to by <em>palette</em>. If <em>d</em> is 1 or 8, the returned
|
---|
| 427 | image will have its color table ordered the same as <em>palette</em>.
|
---|
| 428 | <p> If the image needs to be modified to fit in a lower-resolution
|
---|
| 429 | result (e.g. converting from 32-bit to 8-bit), use the <em>conversion_flags</em> to specify how you'd prefer this to happen.
|
---|
| 430 | <p> Note: currently no closest-color search is made. If colors are
|
---|
| 431 | found that are not in the palette, the palette may not be used at
|
---|
| 432 | all. This result should not be considered valid because it may
|
---|
| 433 | change in future implementations.
|
---|
| 434 | <p> Currently inefficient for non-32-bit images.
|
---|
| 435 | <p> <p>See also <a href="qt.html#ImageConversionFlags-enum">Qt::ImageConversionFlags</a>.
|
---|
| 436 |
|
---|
| 437 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="copy"></a>QImage::copy () const
|
---|
| 438 | </h3>
|
---|
| 439 | Returns a <a href="shclass.html">deep copy</a> of the image.
|
---|
| 440 | <p> <p>See also <a href="#detach">detach</a>().
|
---|
| 441 |
|
---|
| 442 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="copy-2"></a>QImage::copy ( int x, int y, int w, int h, int conversion_flags = 0 ) const
|
---|
| 443 | </h3>
|
---|
| 444 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 445 | <p> Returns a <a href="shclass.html">deep copy</a> of a sub-area of
|
---|
| 446 | the image.
|
---|
| 447 | <p> The returned image is always <em>w</em> by <em>h</em> pixels in size, and is
|
---|
| 448 | copied from position <em>x</em>, <em>y</em> in this image. In areas beyond
|
---|
| 449 | this image pixels are filled with pixel 0.
|
---|
| 450 | <p> If the image needs to be modified to fit in a lower-resolution
|
---|
| 451 | result (e.g. converting from 32-bit to 8-bit), use the <em>conversion_flags</em> to specify how you'd prefer this to happen.
|
---|
| 452 | <p> <p>See also <a href="#bitBlt">bitBlt</a>() and <a href="qt.html#ImageConversionFlags-enum">Qt::ImageConversionFlags</a>.
|
---|
| 453 |
|
---|
| 454 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="copy-3"></a>QImage::copy ( const <a href="qrect.html">QRect</a> & r ) const
|
---|
| 455 | </h3>
|
---|
| 456 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 457 | <p> Returns a <a href="shclass.html">deep copy</a> of a sub-area of
|
---|
| 458 | the image.
|
---|
| 459 | <p> The returned image always has the size of the rectangle <em>r</em>. In
|
---|
| 460 | areas beyond this image pixels are filled with pixel 0.
|
---|
| 461 |
|
---|
| 462 | <h3 class=fn>bool <a name="create"></a>QImage::create ( int width, int height, int depth, int numColors = 0, <a href="qimage.html#Endian-enum">Endian</a> bitOrder = IgnoreEndian )
|
---|
| 463 | </h3>
|
---|
| 464 | Sets the image <em>width</em>, <em>height</em>, <em>depth</em>, its number of colors
|
---|
| 465 | (in <em>numColors</em>), and bit order. Returns TRUE if successful, or
|
---|
| 466 | FALSE if the parameters are incorrect or if memory cannot be
|
---|
| 467 | allocated.
|
---|
| 468 | <p> The <em>width</em> and <em>height</em> is limited to 32767. <em>depth</em> must be
|
---|
| 469 | 1, 8, or 32. If <em>depth</em> is 1, <em>bitOrder</em> must be set to
|
---|
| 470 | either QImage::LittleEndian or QImage::BigEndian. For other depths
|
---|
| 471 | <em>bitOrder</em> must be QImage::IgnoreEndian.
|
---|
| 472 | <p> This function allocates a color table and a buffer for the image
|
---|
| 473 | data. The image data is not initialized.
|
---|
| 474 | <p> The image buffer is allocated as a single block that consists of a
|
---|
| 475 | table of <a href="#scanLine">scanline</a> pointers (<a href="#jumpTable">jumpTable</a>())
|
---|
| 476 | and the image data (<a href="#bits">bits</a>()).
|
---|
| 477 | <p> <p>See also <a href="#fill">fill</a>(), <a href="#width">width</a>(), <a href="#height">height</a>(), <a href="#depth">depth</a>(), <a href="#numColors">numColors</a>(), <a href="#bitOrder">bitOrder</a>(), <a href="#jumpTable">jumpTable</a>(), <a href="#scanLine">scanLine</a>(), <a href="#bits">bits</a>(), <a href="#bytesPerLine">bytesPerLine</a>(), and <a href="#numBytes">numBytes</a>().
|
---|
| 478 |
|
---|
| 479 | <h3 class=fn>bool <a name="create-2"></a>QImage::create ( const <a href="qsize.html">QSize</a> &, int depth, int numColors = 0, <a href="qimage.html#Endian-enum">Endian</a> bitOrder = IgnoreEndian )
|
---|
| 480 | </h3>
|
---|
| 481 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 482 | <p>
|
---|
| 483 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="createAlphaMask"></a>QImage::createAlphaMask ( int conversion_flags = 0 ) const
|
---|
| 484 | </h3>
|
---|
| 485 | Builds and returns a 1-bpp mask from the alpha buffer in this
|
---|
| 486 | image. Returns a <a href="#isNull">null</a> image if <a href="#setAlphaBuffer">alpha buffer mode</a> is disabled.
|
---|
| 487 | <p> See <a href="qpixmap.html#convertFromImage">QPixmap::convertFromImage</a>() for a description of the <em>conversion_flags</em> argument.
|
---|
| 488 | <p> The returned image has little-endian bit order, which you can
|
---|
| 489 | convert to big-endianness using <a href="#convertBitOrder">convertBitOrder</a>().
|
---|
| 490 | <p> <p>See also <a href="#createHeuristicMask">createHeuristicMask</a>(), <a href="#hasAlphaBuffer">hasAlphaBuffer</a>(), and <a href="#setAlphaBuffer">setAlphaBuffer</a>().
|
---|
| 491 |
|
---|
| 492 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="createHeuristicMask"></a>QImage::createHeuristicMask ( bool clipTight = TRUE ) const
|
---|
| 493 | </h3>
|
---|
| 494 | Creates and returns a 1-bpp heuristic mask for this image. It
|
---|
| 495 | works by selecting a color from one of the corners, then chipping
|
---|
| 496 | away pixels of that color starting at all the edges.
|
---|
| 497 | <p> The four corners vote for which color is to be masked away. In
|
---|
| 498 | case of a draw (this generally means that this function is not
|
---|
| 499 | applicable to the image), the result is arbitrary.
|
---|
| 500 | <p> The returned image has little-endian bit order, which you can
|
---|
| 501 | convert to big-endianness using <a href="#convertBitOrder">convertBitOrder</a>().
|
---|
| 502 | <p> If <em>clipTight</em> is TRUE the mask is just large enough to cover the
|
---|
| 503 | pixels; otherwise, the mask is larger than the data pixels.
|
---|
| 504 | <p> This function disregards the <a href="#hasAlphaBuffer">alpha buffer</a>.
|
---|
| 505 | <p> <p>See also <a href="#createAlphaMask">createAlphaMask</a>().
|
---|
| 506 |
|
---|
| 507 | <h3 class=fn>int <a name="depth"></a>QImage::depth () const
|
---|
| 508 | </h3>
|
---|
| 509 |
|
---|
| 510 | <p> Returns the depth of the image.
|
---|
| 511 | <p> The image depth is the number of bits used to encode a single
|
---|
| 512 | pixel, also called bits per pixel (bpp) or bit planes of an image.
|
---|
| 513 | <p> The supported depths are 1, 8, 16 (Qt/Embedded only) and 32.
|
---|
| 514 | <p> <p>See also <a href="#convertDepth">convertDepth</a>().
|
---|
| 515 |
|
---|
| 516 | <h3 class=fn>void <a name="detach"></a>QImage::detach ()
|
---|
| 517 | </h3>
|
---|
| 518 | Detaches from shared image data and makes sure that this image is
|
---|
| 519 | the only one referring to the data.
|
---|
| 520 | <p> If multiple images share common data, this image makes a copy of
|
---|
| 521 | the data and detaches itself from the sharing mechanism.
|
---|
| 522 | Nothing is done if there is just a single reference.
|
---|
| 523 | <p> <p>See also <a href="#copy">copy</a>().
|
---|
| 524 |
|
---|
| 525 | <p>Example: <a href="themes-example.html#x208">themes/wood.cpp</a>.
|
---|
| 526 | <h3 class=fn>int <a name="dotsPerMeterX"></a>QImage::dotsPerMeterX () const
|
---|
| 527 | </h3>
|
---|
| 528 |
|
---|
| 529 | <p> Returns the number of pixels that fit horizontally in a physical
|
---|
| 530 | meter. This and <a href="#dotsPerMeterY">dotsPerMeterY</a>() define the intended scale and
|
---|
| 531 | aspect ratio of the image.
|
---|
| 532 | <p> <p>See also <a href="#setDotsPerMeterX">setDotsPerMeterX</a>().
|
---|
| 533 |
|
---|
| 534 | <h3 class=fn>int <a name="dotsPerMeterY"></a>QImage::dotsPerMeterY () const
|
---|
| 535 | </h3>
|
---|
| 536 |
|
---|
| 537 | <p> Returns the number of pixels that fit vertically in a physical
|
---|
| 538 | meter. This and <a href="#dotsPerMeterX">dotsPerMeterX</a>() define the intended scale and
|
---|
| 539 | aspect ratio of the image.
|
---|
| 540 | <p> <p>See also <a href="#setDotsPerMeterY">setDotsPerMeterY</a>().
|
---|
| 541 |
|
---|
| 542 | <h3 class=fn>void <a name="fill"></a>QImage::fill ( uint pixel )
|
---|
| 543 | </h3>
|
---|
| 544 | Fills the entire image with the pixel value <em>pixel</em>.
|
---|
| 545 | <p> If the <a href="#depth">depth</a> of this image is 1, only the
|
---|
| 546 | lowest bit is used. If you say <a href="#fill">fill</a>(0), fill(2), etc., the image
|
---|
| 547 | is filled with 0s. If you say fill(1), fill(3), etc., the image is
|
---|
| 548 | filled with 1s. If the depth is 8, the lowest 8 bits are used.
|
---|
| 549 | <p> If the depth is 32 and the image has no alpha buffer, the <em>pixel</em>
|
---|
| 550 | value is written to each pixel in the image. If the image has an
|
---|
| 551 | alpha buffer, only the 24 RGB bits are set and the upper 8 bits
|
---|
| 552 | (alpha value) are left unchanged.
|
---|
| 553 | <p> Note: <a href="#pixel">QImage::pixel</a>() returns the color of the pixel at the given
|
---|
| 554 | coordinates; <a href="qcolor.html#pixel">QColor::pixel</a>() returns the pixel value of the
|
---|
| 555 | underlying window system (essentially an index value), so normally
|
---|
| 556 | you will want to use QImage::pixel() to use a color from an
|
---|
| 557 | existing image or <a href="qcolor.html#rgb">QColor::rgb</a>() to use a specific color.
|
---|
| 558 | <p> <p>See also <a href="#invertPixels">invertPixels</a>(), <a href="#depth">depth</a>(), <a href="#hasAlphaBuffer">hasAlphaBuffer</a>(), and <a href="#create">create</a>().
|
---|
| 559 |
|
---|
| 560 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="fromMimeSource"></a>QImage::fromMimeSource ( const <a href="qstring.html">QString</a> & abs_name )<tt> [static]</tt>
|
---|
| 561 | </h3> Convenience function. Gets the data associated with the absolute
|
---|
| 562 | name <em>abs_name</em> from the default mime source factory and decodes it
|
---|
| 563 | to an image.
|
---|
| 564 | <p> <p>See also <a href="qmimesourcefactory.html">QMimeSourceFactory</a>, <a href="#fromMimeSource">QImage::fromMimeSource</a>(), and <a href="qimagedrag.html#decode">QImageDrag::decode</a>().
|
---|
| 565 |
|
---|
| 566 | <h3 class=fn>bool <a name="hasAlphaBuffer"></a>QImage::hasAlphaBuffer () const
|
---|
| 567 | </h3>
|
---|
| 568 |
|
---|
| 569 | <p> Returns TRUE if alpha buffer mode is enabled; otherwise returns
|
---|
| 570 | FALSE.
|
---|
| 571 | <p> <p>See also <a href="#setAlphaBuffer">setAlphaBuffer</a>().
|
---|
| 572 |
|
---|
| 573 | <h3 class=fn>int <a name="height"></a>QImage::height () const
|
---|
| 574 | </h3>
|
---|
| 575 |
|
---|
| 576 | <p> Returns the height of the image.
|
---|
| 577 | <p> <p>See also <a href="#width">width</a>(), <a href="#size">size</a>(), and <a href="#rect">rect</a>().
|
---|
| 578 |
|
---|
| 579 | <p>Examples: <a href="canvas-example.html#x2932">canvas/canvas.cpp</a> and <a href="qglwidget.html#x2120">opengl/texture/gltexobj.cpp</a>.
|
---|
| 580 | <h3 class=fn>const char * <a name="imageFormat"></a>QImage::imageFormat ( const <a href="qstring.html">QString</a> & fileName )<tt> [static]</tt>
|
---|
| 581 | </h3>
|
---|
| 582 | Returns a string that specifies the image format of the file <em>fileName</em>, or 0 if the file cannot be read or if the format is not
|
---|
| 583 | recognized.
|
---|
| 584 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the guaranteed supported image
|
---|
| 585 | formats, or use <a href="#inputFormats">QImage::inputFormats</a>() and <a href="#outputFormats">QImage::outputFormats</a>()
|
---|
| 586 | to get lists that include the installed formats.
|
---|
| 587 | <p> <p>See also <a href="#load">load</a>() and <a href="#save">save</a>().
|
---|
| 588 |
|
---|
| 589 | <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="inputFormatList"></a>QImage::inputFormatList ()<tt> [static]</tt>
|
---|
| 590 | </h3>
|
---|
| 591 | Returns a list of image formats that are supported for image
|
---|
| 592 | input.
|
---|
| 593 | <p> Note that if you want to iterate over the list, you should iterate
|
---|
| 594 | over a copy, e.g.
|
---|
| 595 | <pre>
|
---|
| 596 | <a href="qstringlist.html">QStringList</a> list = myImage.inputFormatList();
|
---|
| 597 | QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
|
---|
| 598 | while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
|
---|
| 599 | myProcessing( *it );
|
---|
| 600 | ++it;
|
---|
| 601 | }
|
---|
| 602 | </pre>
|
---|
| 603 |
|
---|
| 604 | <p> <p>See also <a href="#outputFormatList">outputFormatList</a>(), <a href="#inputFormats">inputFormats</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 605 |
|
---|
| 606 | <p>Example: <a href="showimg-example.html#x1321">showimg/showimg.cpp</a>.
|
---|
| 607 | <h3 class=fn><a href="qstrlist.html">QStrList</a> <a name="inputFormats"></a>QImage::inputFormats ()<tt> [static]</tt>
|
---|
| 608 | </h3>
|
---|
| 609 | Returns a list of image formats that are supported for image
|
---|
| 610 | input.
|
---|
| 611 | <p> <p>See also <a href="#outputFormats">outputFormats</a>(), <a href="#inputFormatList">inputFormatList</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 612 |
|
---|
| 613 | <h3 class=fn>void <a name="invertPixels"></a>QImage::invertPixels ( bool invertAlpha = TRUE )
|
---|
| 614 | </h3>
|
---|
| 615 | Inverts all pixel values in the image.
|
---|
| 616 | <p> If the depth is 32: if <em>invertAlpha</em> is TRUE, the alpha bits are
|
---|
| 617 | also inverted, otherwise they are left unchanged.
|
---|
| 618 | <p> If the depth is not 32, the argument <em>invertAlpha</em> has no
|
---|
| 619 | meaning.
|
---|
| 620 | <p> Note that inverting an 8-bit image means to replace all pixels
|
---|
| 621 | using color index <em>i</em> with a pixel using color index 255 minus <em>i</em>. Similarly for a 1-bit image. The color table is not changed.
|
---|
| 622 | <p> <p>See also <a href="#fill">fill</a>(), <a href="#depth">depth</a>(), and <a href="#hasAlphaBuffer">hasAlphaBuffer</a>().
|
---|
| 623 |
|
---|
| 624 | <h3 class=fn>bool <a name="isGrayscale"></a>QImage::isGrayscale () const
|
---|
| 625 | </h3>
|
---|
| 626 | For 16-bit (Qt/Embedded only) and 32-bit images, this function is
|
---|
| 627 | equivalent to <a href="#allGray">allGray</a>().
|
---|
| 628 | <p> For 8-bpp images, this function returns TRUE if <a href="#color">color</a>(i) is
|
---|
| 629 | QRgb(i,i,i) for all indices of the color table; otherwise returns
|
---|
| 630 | FALSE.
|
---|
| 631 | <p> <p>See also <a href="#allGray">allGray</a>() and <a href="#depth">depth</a>().
|
---|
| 632 |
|
---|
| 633 | <h3 class=fn>bool <a name="isNull"></a>QImage::isNull () const
|
---|
| 634 | </h3>
|
---|
| 635 |
|
---|
| 636 | <p> Returns TRUE if it is a null image; otherwise returns FALSE.
|
---|
| 637 | <p> A null image has all parameters set to zero and no allocated data.
|
---|
| 638 |
|
---|
| 639 | <p>Example: <a href="showimg-example.html#x1322">showimg/showimg.cpp</a>.
|
---|
| 640 | <h3 class=fn>uchar ** <a name="jumpTable"></a>QImage::jumpTable () const
|
---|
| 641 | </h3>
|
---|
| 642 |
|
---|
| 643 | <p> Returns a pointer to the scanline pointer table.
|
---|
| 644 | <p> This is the beginning of the data block for the image.
|
---|
| 645 | <p> <p>See also <a href="#bits">bits</a>() and <a href="#scanLine">scanLine</a>().
|
---|
| 646 |
|
---|
| 647 | <h3 class=fn>bool <a name="load"></a>QImage::load ( const <a href="qstring.html">QString</a> & fileName, const char * format = 0 )
|
---|
| 648 | </h3>
|
---|
| 649 | Loads an image from the file <em>fileName</em>. Returns TRUE if the
|
---|
| 650 | image was successfully loaded; otherwise returns FALSE.
|
---|
| 651 | <p> If <em>format</em> is specified, the loader attempts to read the image
|
---|
| 652 | using the specified format. If <em>format</em> is not specified (which
|
---|
| 653 | is the default), the loader reads a few bytes from the header to
|
---|
| 654 | guess the file format.
|
---|
| 655 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
|
---|
| 656 | explains how to add extra formats.
|
---|
| 657 | <p> <p>See also <a href="#loadFromData">loadFromData</a>(), <a href="#save">save</a>(), <a href="#imageFormat">imageFormat</a>(), <a href="qpixmap.html#load">QPixmap::load</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 658 |
|
---|
| 659 | <h3 class=fn>bool <a name="loadFromData"></a>QImage::loadFromData ( const uchar * buf, uint len, const char * format = 0 )
|
---|
| 660 | </h3>
|
---|
| 661 | Loads an image from the first <em>len</em> bytes of binary data in <em>buf</em>. Returns TRUE if the image was successfully loaded; otherwise
|
---|
| 662 | returns FALSE.
|
---|
| 663 | <p> If <em>format</em> is specified, the loader attempts to read the image
|
---|
| 664 | using the specified format. If <em>format</em> is not specified (which
|
---|
| 665 | is the default), the loader reads a few bytes from the header to
|
---|
| 666 | guess the file format.
|
---|
| 667 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
|
---|
| 668 | explains how to add extra formats.
|
---|
| 669 | <p> <p>See also <a href="#load">load</a>(), <a href="#save">save</a>(), <a href="#imageFormat">imageFormat</a>(), <a href="qpixmap.html#loadFromData">QPixmap::loadFromData</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 670 |
|
---|
| 671 | <h3 class=fn>bool <a name="loadFromData-2"></a>QImage::loadFromData ( <a href="qbytearray.html">QByteArray</a> buf, const char * format = 0 )
|
---|
| 672 | </h3>
|
---|
| 673 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 674 | <p> Loads an image from the <a href="qbytearray.html">QByteArray</a> <em>buf</em>.
|
---|
| 675 |
|
---|
| 676 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="mirror"></a>QImage::mirror () const
|
---|
| 677 | </h3>
|
---|
| 678 | Returns a QImage which is a vertically mirrored copy of this
|
---|
| 679 | image. The original QImage is not changed.
|
---|
| 680 |
|
---|
| 681 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="mirror-2"></a>QImage::mirror ( bool horizontal, bool vertical ) const
|
---|
| 682 | </h3>
|
---|
| 683 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 684 | <p> Returns a mirror of the image, mirrored in the horizontal and/or
|
---|
| 685 | the vertical direction depending on whether <em>horizontal</em> and <em>vertical</em> are set to TRUE or FALSE. The original image is not
|
---|
| 686 | changed.
|
---|
| 687 | <p> <p>See also <a href="#smoothScale">smoothScale</a>().
|
---|
| 688 |
|
---|
| 689 | <h3 class=fn>int <a name="numBytes"></a>QImage::numBytes () const
|
---|
| 690 | </h3>
|
---|
| 691 |
|
---|
| 692 | <p> Returns the number of bytes occupied by the image data.
|
---|
| 693 | <p> <p>See also <a href="#bytesPerLine">bytesPerLine</a>() and <a href="#bits">bits</a>().
|
---|
| 694 |
|
---|
| 695 | <h3 class=fn>int <a name="numColors"></a>QImage::numColors () const
|
---|
| 696 | </h3>
|
---|
| 697 |
|
---|
| 698 | <p> Returns the size of the color table for the image.
|
---|
| 699 | <p> Notice that <a href="#numColors">numColors</a>() returns 0 for 16-bpp (Qt/Embedded only)
|
---|
| 700 | and 32-bpp images because these images do not use color tables,
|
---|
| 701 | but instead encode pixel values as RGB triplets.
|
---|
| 702 | <p> <p>See also <a href="#setNumColors">setNumColors</a>() and <a href="#colorTable">colorTable</a>().
|
---|
| 703 |
|
---|
| 704 | <p>Example: <a href="themes-example.html#x209">themes/wood.cpp</a>.
|
---|
| 705 | <h3 class=fn><a href="qpoint.html">QPoint</a> <a name="offset"></a>QImage::offset () const
|
---|
| 706 | </h3>
|
---|
| 707 |
|
---|
| 708 | <p> Returns the number of pixels by which the image is intended to be
|
---|
| 709 | offset by when positioning relative to other images.
|
---|
| 710 |
|
---|
| 711 | <h3 class=fn>bool <a name="operator!-eq"></a>QImage::operator!= ( const <a href="qimage.html">QImage</a> & i ) const
|
---|
| 712 | </h3>
|
---|
| 713 | Returns TRUE if this image and image <em>i</em> have different contents;
|
---|
| 714 | otherwise returns FALSE. The comparison can be slow, unless there
|
---|
| 715 | is some obvious difference, such as different widths, in which
|
---|
| 716 | case the function will return quickly.
|
---|
| 717 | <p> <p>See also <a href="#operator-eq">operator=</a>().
|
---|
| 718 |
|
---|
| 719 | <h3 class=fn><a href="qimage.html">QImage</a> & <a name="operator-eq"></a>QImage::operator= ( const <a href="qimage.html">QImage</a> & image )
|
---|
| 720 | </h3>
|
---|
| 721 | Assigns a <a href="shclass.html">shallow copy</a> of <em>image</em> to
|
---|
| 722 | this image and returns a reference to this image.
|
---|
| 723 | <p> <p>See also <a href="#copy">copy</a>().
|
---|
| 724 |
|
---|
| 725 | <h3 class=fn><a href="qimage.html">QImage</a> & <a name="operator-eq-2"></a>QImage::operator= ( const <a href="qpixmap.html">QPixmap</a> & pixmap )
|
---|
| 726 | </h3>
|
---|
| 727 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 728 | <p> Sets the image bits to the <em>pixmap</em> contents and returns a
|
---|
| 729 | reference to the image.
|
---|
| 730 | <p> If the image shares data with other images, it will first
|
---|
| 731 | dereference the shared data.
|
---|
| 732 | <p> Makes a call to <a href="qpixmap.html#convertToImage">QPixmap::convertToImage</a>().
|
---|
| 733 |
|
---|
| 734 | <h3 class=fn>bool <a name="operator-eq-eq"></a>QImage::operator== ( const <a href="qimage.html">QImage</a> & i ) const
|
---|
| 735 | </h3>
|
---|
| 736 | Returns TRUE if this image and image <em>i</em> have the same contents;
|
---|
| 737 | otherwise returns FALSE. The comparison can be slow, unless there
|
---|
| 738 | is some obvious difference, such as different widths, in which
|
---|
| 739 | case the function will return quickly.
|
---|
| 740 | <p> <p>See also <a href="#operator-eq">operator=</a>().
|
---|
| 741 |
|
---|
| 742 | <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="outputFormatList"></a>QImage::outputFormatList ()<tt> [static]</tt>
|
---|
| 743 | </h3>
|
---|
| 744 | Returns a list of image formats that are supported for image
|
---|
| 745 | output.
|
---|
| 746 | <p> Note that if you want to iterate over the list, you should iterate
|
---|
| 747 | over a copy, e.g.
|
---|
| 748 | <pre>
|
---|
| 749 | <a href="qstringlist.html">QStringList</a> list = myImage.outputFormatList();
|
---|
| 750 | QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
|
---|
| 751 | while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
|
---|
| 752 | myProcessing( *it );
|
---|
| 753 | ++it;
|
---|
| 754 | }
|
---|
| 755 | </pre>
|
---|
| 756 |
|
---|
| 757 | <p> <p>See also <a href="#inputFormatList">inputFormatList</a>(), <a href="#outputFormats">outputFormats</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 758 |
|
---|
| 759 | <h3 class=fn><a href="qstrlist.html">QStrList</a> <a name="outputFormats"></a>QImage::outputFormats ()<tt> [static]</tt>
|
---|
| 760 | </h3>
|
---|
| 761 | Returns a list of image formats that are supported for image
|
---|
| 762 | output.
|
---|
| 763 | <p> <p>See also <a href="#inputFormats">inputFormats</a>(), <a href="#outputFormatList">outputFormatList</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 764 |
|
---|
| 765 | <p>Example: <a href="showimg-example.html#x1323">showimg/showimg.cpp</a>.
|
---|
| 766 | <h3 class=fn>QRgb <a name="pixel"></a>QImage::pixel ( int x, int y ) const
|
---|
| 767 | </h3>
|
---|
| 768 | Returns the color of the pixel at the coordinates (<em>x</em>, <em>y</em>).
|
---|
| 769 | <p> If (<em>x</em>, <em>y</em>) is not <a href="#valid">on the image</a>, the
|
---|
| 770 | results are undefined.
|
---|
| 771 | <p> <p>See also <a href="#setPixel">setPixel</a>(), <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qGreen">qGreen</a>(), <a href="qcolor.html#qBlue">qBlue</a>(), and <a href="#valid">valid</a>().
|
---|
| 772 |
|
---|
| 773 | <p>Examples: <a href="canvas-example.html#x2933">canvas/canvas.cpp</a> and <a href="qmag-example.html#x1776">qmag/qmag.cpp</a>.
|
---|
| 774 | <h3 class=fn>int <a name="pixelIndex"></a>QImage::pixelIndex ( int x, int y ) const
|
---|
| 775 | </h3>
|
---|
| 776 | Returns the pixel index at the given coordinates.
|
---|
| 777 | <p> If (<em>x</em>, <em>y</em>) is not <a href="#valid">valid</a>, or if the
|
---|
| 778 | image is not a paletted image (<a href="#depth">depth</a>() > 8), the results are
|
---|
| 779 | undefined.
|
---|
| 780 | <p> <p>See also <a href="#valid">valid</a>() and <a href="#depth">depth</a>().
|
---|
| 781 |
|
---|
| 782 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="rect"></a>QImage::rect () const
|
---|
| 783 | </h3>
|
---|
| 784 |
|
---|
| 785 | <p> Returns the enclosing rectangle (0, 0, <a href="#width">width</a>(), <a href="#height">height</a>()) of the
|
---|
| 786 | image.
|
---|
| 787 | <p> <p>See also <a href="#width">width</a>(), <a href="#height">height</a>(), and <a href="#size">size</a>().
|
---|
| 788 |
|
---|
| 789 | <h3 class=fn>void <a name="reset"></a>QImage::reset ()
|
---|
| 790 | </h3>
|
---|
| 791 | Resets all image parameters and deallocates the image data.
|
---|
| 792 |
|
---|
| 793 | <h3 class=fn>bool <a name="save"></a>QImage::save ( const <a href="qstring.html">QString</a> & fileName, const char * format, int quality = -1 ) const
|
---|
| 794 | </h3>
|
---|
| 795 | Saves the image to the file <em>fileName</em>, using the image file
|
---|
| 796 | format <em>format</em> and a quality factor of <em>quality</em>. <em>quality</em>
|
---|
| 797 | must be in the range 0..100 or -1. Specify 0 to obtain small
|
---|
| 798 | compressed files, 100 for large uncompressed files, and -1 (the
|
---|
| 799 | default) to use the default settings.
|
---|
| 800 | <p> Returns TRUE if the image was successfully saved; otherwise
|
---|
| 801 | returns FALSE.
|
---|
| 802 | <p> <p>See also <a href="#load">load</a>(), <a href="#loadFromData">loadFromData</a>(), <a href="#imageFormat">imageFormat</a>(), <a href="qpixmap.html#save">QPixmap::save</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 803 |
|
---|
| 804 | <h3 class=fn>bool <a name="save-2"></a>QImage::save ( <a href="qiodevice.html">QIODevice</a> * device, const char * format, int quality = -1 ) const
|
---|
| 805 | </h3>
|
---|
| 806 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 807 | <p> This function writes a QImage to the <a href="qiodevice.html">QIODevice</a>, <em>device</em>. This
|
---|
| 808 | can be used, for example, to save an image directly into a
|
---|
| 809 | QByteArray:
|
---|
| 810 | <pre>
|
---|
| 811 | QImage image;
|
---|
| 812 | <a href="qbytearray.html">QByteArray</a> ba;
|
---|
| 813 | <a href="qbuffer.html">QBuffer</a> buffer( ba );
|
---|
| 814 | buffer.<a href="qiodevice.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> );
|
---|
| 815 | image.<a href="#save">save</a>( &buffer, "PNG" ); // writes image into ba in PNG format
|
---|
| 816 | </pre>
|
---|
| 817 |
|
---|
| 818 |
|
---|
| 819 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="scale"></a>QImage::scale ( int w, int h, <a href="qimage.html#ScaleMode-enum">ScaleMode</a> mode = ScaleFree ) const
|
---|
| 820 | </h3>
|
---|
| 821 | Returns a copy of the image scaled to a rectangle of width <em>w</em>
|
---|
| 822 | and height <em>h</em> according to the ScaleMode <em>mode</em>.
|
---|
| 823 | <p> <ul>
|
---|
| 824 | <li> If <em>mode</em> is <a href="#ScaleMode-enum">ScaleFree</a>, the image is scaled to (<em>w</em>,
|
---|
| 825 | <em>h</em>).
|
---|
| 826 | <li> If <em>mode</em> is <a href="#ScaleMode-enum">ScaleMin</a>, the image is scaled to a rectangle
|
---|
| 827 | as large as possible inside (<em>w</em>, <em>h</em>), preserving the aspect
|
---|
| 828 | ratio.
|
---|
| 829 | <li> If <em>mode</em> is <a href="#ScaleMode-enum">ScaleMax</a>, the image is scaled to a rectangle
|
---|
| 830 | as small as possible outside (<em>w</em>, <em>h</em>), preserving the aspect
|
---|
| 831 | ratio.
|
---|
| 832 | </ul>
|
---|
| 833 | <p> If either the width <em>w</em> or the height <em>h</em> is 0 or negative, this
|
---|
| 834 | function returns a <a href="#isNull">null</a> image.
|
---|
| 835 | <p> This function uses a simple, fast algorithm. If you need better
|
---|
| 836 | quality, use <a href="#smoothScale">smoothScale</a>() instead.
|
---|
| 837 | <p> <p>See also <a href="#scaleWidth">scaleWidth</a>(), <a href="#scaleHeight">scaleHeight</a>(), <a href="#smoothScale">smoothScale</a>(), and <a href="#xForm">xForm</a>().
|
---|
| 838 |
|
---|
| 839 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="scale-2"></a>QImage::scale ( const <a href="qsize.html">QSize</a> & s, <a href="qimage.html#ScaleMode-enum">ScaleMode</a> mode = ScaleFree ) const
|
---|
| 840 | </h3>
|
---|
| 841 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 842 | <p> The requested size of the image is <em>s</em>.
|
---|
| 843 |
|
---|
| 844 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="scaleHeight"></a>QImage::scaleHeight ( int h ) const
|
---|
| 845 | </h3>
|
---|
| 846 | Returns a scaled copy of the image. The returned image has a
|
---|
| 847 | height of <em>h</em> pixels. This function automatically calculates the
|
---|
| 848 | width of the image so that the ratio of the image is preserved.
|
---|
| 849 | <p> If <em>h</em> is 0 or negative a <a href="#isNull">null</a> image is
|
---|
| 850 | returned.
|
---|
| 851 | <p> <p>See also <a href="#scale">scale</a>(), <a href="#scaleWidth">scaleWidth</a>(), <a href="#smoothScale">smoothScale</a>(), and <a href="#xForm">xForm</a>().
|
---|
| 852 |
|
---|
| 853 | <p>Example: <a href="small-table-example-example.html#x2799">table/small-table-demo/main.cpp</a>.
|
---|
| 854 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="scaleWidth"></a>QImage::scaleWidth ( int w ) const
|
---|
| 855 | </h3>
|
---|
| 856 | Returns a scaled copy of the image. The returned image has a width
|
---|
| 857 | of <em>w</em> pixels. This function automatically calculates the height
|
---|
| 858 | of the image so that the ratio of the image is preserved.
|
---|
| 859 | <p> If <em>w</em> is 0 or negative a <a href="#isNull">null</a> image is
|
---|
| 860 | returned.
|
---|
| 861 | <p> <p>See also <a href="#scale">scale</a>(), <a href="#scaleHeight">scaleHeight</a>(), <a href="#smoothScale">smoothScale</a>(), and <a href="#xForm">xForm</a>().
|
---|
| 862 |
|
---|
| 863 | <h3 class=fn>uchar * <a name="scanLine"></a>QImage::scanLine ( int i ) const
|
---|
| 864 | </h3>
|
---|
| 865 |
|
---|
| 866 | <p> Returns a pointer to the pixel data at the scanline with index <em>i</em>. The first scanline is at index 0.
|
---|
| 867 | <p> The scanline data is aligned on a 32-bit boundary.
|
---|
| 868 | <p> <b>Warning:</b> If you are accessing 32-bpp image data, cast the returned
|
---|
| 869 | pointer to <tt>QRgb*</tt> (QRgb has a 32-bit size) and use it to
|
---|
| 870 | read/write the pixel value. You cannot use the <tt>uchar*</tt> pointer
|
---|
| 871 | directly, because the pixel format depends on the byte order on
|
---|
| 872 | the underlying platform. Hint: use <a href="qcolor.html#qRed">qRed()</a>,
|
---|
| 873 | <a href="qcolor.html#qGreen">qGreen()</a> and <a href="qcolor.html#qBlue">qBlue()</a>, etc. (qcolor.h) to access the pixels.
|
---|
| 874 | <p> <b>Warning:</b> If you are accessing 16-bpp image data, you must handle
|
---|
| 875 | endianness yourself. (Qt/Embedded only)
|
---|
| 876 | <p> <p>See also <a href="#bytesPerLine">bytesPerLine</a>(), <a href="#bits">bits</a>(), and <a href="#jumpTable">jumpTable</a>().
|
---|
| 877 |
|
---|
| 878 | <p>Example: <a href="desktop-example.html#x1729">desktop/desktop.cpp</a>.
|
---|
| 879 | <h3 class=fn>void <a name="setAlphaBuffer"></a>QImage::setAlphaBuffer ( bool enable )
|
---|
| 880 | </h3>
|
---|
| 881 | Enables alpha buffer mode if <em>enable</em> is TRUE, otherwise disables
|
---|
| 882 | it. The default setting is disabled.
|
---|
| 883 | <p> An 8-bpp image has 8-bit pixels. A pixel is an index into the
|
---|
| 884 | <a href="#color">color table</a>, which contains 32-bit color
|
---|
| 885 | values. In a 32-bpp image, the 32-bit pixels are the color values.
|
---|
| 886 | <p> This 32-bit value is encoded as follows: The lower 24 bits are
|
---|
| 887 | used for the red, green, and blue components. The upper 8 bits
|
---|
| 888 | contain the alpha component.
|
---|
| 889 | <p> The alpha component specifies the transparency of a pixel. 0 means
|
---|
| 890 | completely transparent and 255 means opaque. The alpha component
|
---|
| 891 | is ignored if you do not enable alpha buffer mode.
|
---|
| 892 | <p> The alpha buffer is used to set a mask when a QImage is translated
|
---|
| 893 | to a <a href="qpixmap.html">QPixmap</a>.
|
---|
| 894 | <p> <p>See also <a href="#hasAlphaBuffer">hasAlphaBuffer</a>() and <a href="#createAlphaMask">createAlphaMask</a>().
|
---|
| 895 |
|
---|
| 896 | <h3 class=fn>void <a name="setColor"></a>QImage::setColor ( int i, QRgb c )
|
---|
| 897 | </h3>
|
---|
| 898 |
|
---|
| 899 | <p> Sets a color in the color table at index <em>i</em> to <em>c</em>.
|
---|
| 900 | <p> A color value is an RGB triplet. Use the <a href="qcolor.html#qRgb">qRgb()</a> function (defined in <a href="qcolor-h.html">qcolor.h</a>) to make RGB
|
---|
| 901 | triplets.
|
---|
| 902 | <p> <p>See also <a href="#color">color</a>(), <a href="#setNumColors">setNumColors</a>(), and <a href="#numColors">numColors</a>().
|
---|
| 903 |
|
---|
| 904 | <p>Examples: <a href="desktop-example.html#x1730">desktop/desktop.cpp</a> and <a href="themes-example.html#x210">themes/wood.cpp</a>.
|
---|
| 905 | <h3 class=fn>void <a name="setDotsPerMeterX"></a>QImage::setDotsPerMeterX ( int x )
|
---|
| 906 | </h3>
|
---|
| 907 | Sets the value returned by <a href="#dotsPerMeterX">dotsPerMeterX</a>() to <em>x</em>.
|
---|
| 908 |
|
---|
| 909 | <h3 class=fn>void <a name="setDotsPerMeterY"></a>QImage::setDotsPerMeterY ( int y )
|
---|
| 910 | </h3>
|
---|
| 911 | Sets the value returned by <a href="#dotsPerMeterY">dotsPerMeterY</a>() to <em>y</em>.
|
---|
| 912 |
|
---|
| 913 | <h3 class=fn>void <a name="setNumColors"></a>QImage::setNumColors ( int numColors )
|
---|
| 914 | </h3>
|
---|
| 915 | Resizes the color table to <em>numColors</em> colors.
|
---|
| 916 | <p> If the color table is expanded all the extra colors will be set to
|
---|
| 917 | black (RGB 0,0,0).
|
---|
| 918 | <p> <p>See also <a href="#numColors">numColors</a>(), <a href="#color">color</a>(), <a href="#setColor">setColor</a>(), and <a href="#colorTable">colorTable</a>().
|
---|
| 919 |
|
---|
| 920 | <h3 class=fn>void <a name="setOffset"></a>QImage::setOffset ( const <a href="qpoint.html">QPoint</a> & p )
|
---|
| 921 | </h3>
|
---|
| 922 | Sets the value returned by <a href="#offset">offset</a>() to <em>p</em>.
|
---|
| 923 |
|
---|
| 924 | <h3 class=fn>void <a name="setPixel"></a>QImage::setPixel ( int x, int y, uint index_or_rgb )
|
---|
| 925 | </h3>
|
---|
| 926 | Sets the pixel index or color at the coordinates (<em>x</em>, <em>y</em>) to
|
---|
| 927 | <em>index_or_rgb</em>.
|
---|
| 928 | <p> If (<em>x</em>, <em>y</em>) is not <a href="#valid">valid</a>, the result is
|
---|
| 929 | undefined.
|
---|
| 930 | <p> If the image is a paletted image (<a href="#depth">depth</a>() <= 8) and <em>index_or_rgb</em> >= <a href="#numColors">numColors</a>(), the result is undefined.
|
---|
| 931 | <p> <p>See also <a href="#pixelIndex">pixelIndex</a>(), <a href="#pixel">pixel</a>(), <a href="qcolor.html#qRgb">qRgb</a>(), <a href="qcolor.html#qRgba">qRgba</a>(), and <a href="#valid">valid</a>().
|
---|
| 932 |
|
---|
| 933 | <h3 class=fn>void <a name="setText"></a>QImage::setText ( const char * key, const char * lang, const <a href="qstring.html">QString</a> & s )
|
---|
| 934 | </h3>
|
---|
| 935 | Records string <em>s</em> for the keyword <em>key</em>. The <em>key</em> should be a
|
---|
| 936 | portable keyword recognizable by other software - some suggested
|
---|
| 937 | values can be found in <a href="http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html#C.Anc-text">the PNG specification</a>. <em>s</em> can be any text. <em>lang</em>
|
---|
| 938 | should specify the language code (see
|
---|
| 939 | <a href="http://www.rfc-editor.org/rfc/rfc1766.txt">RFC 1766</a>) or 0.
|
---|
| 940 |
|
---|
| 941 | <h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QImage::size () const
|
---|
| 942 | </h3>
|
---|
| 943 |
|
---|
| 944 | <p> Returns the size of the image, i.e. its width and height.
|
---|
| 945 | <p> <p>See also <a href="#width">width</a>(), <a href="#height">height</a>(), and <a href="#rect">rect</a>().
|
---|
| 946 |
|
---|
| 947 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="smoothScale"></a>QImage::smoothScale ( int w, int h, <a href="qimage.html#ScaleMode-enum">ScaleMode</a> mode = ScaleFree ) const
|
---|
| 948 | </h3>
|
---|
| 949 | Returns a smoothly scaled copy of the image. The returned image
|
---|
| 950 | has a size of width <em>w</em> by height <em>h</em> pixels if <em>mode</em> is <a href="#ScaleMode-enum">ScaleFree</a>. The modes <a href="#ScaleMode-enum">ScaleMin</a> and <a href="#ScaleMode-enum">ScaleMax</a> may be used to
|
---|
| 951 | preserve the ratio of the image: if <em>mode</em> is <a href="#ScaleMode-enum">ScaleMin</a>, the
|
---|
| 952 | returned image is guaranteed to fit into the rectangle specified
|
---|
| 953 | by <em>w</em> and <em>h</em> (it is as large as possible within the
|
---|
| 954 | constraints); if <em>mode</em> is <a href="#ScaleMode-enum">ScaleMax</a>, the returned image fits
|
---|
| 955 | at least into the specified rectangle (it is a small as possible
|
---|
| 956 | within the constraints).
|
---|
| 957 | <p> For 32-bpp images and 1-bpp/8-bpp color images the result will be
|
---|
| 958 | 32-bpp, whereas <a href="#allGray">all-gray</a> images
|
---|
| 959 | (including black-and-white 1-bpp) will produce 8-bit <a href="#isGrayscale">grayscale</a> images with the palette spanning
|
---|
| 960 | 256 grays from black to white.
|
---|
| 961 | <p> This function uses code based on pnmscale.c by Jef Poskanzer.
|
---|
| 962 | <p> pnmscale.c - read a portable anymap and scale it
|
---|
| 963 | <p>
|
---|
| 964 | <p> Copyright (C) 1989, 1991 by Jef Poskanzer.
|
---|
| 965 | <p> Permission to use, copy, modify, and distribute this software and
|
---|
| 966 | its documentation for any purpose and without fee is hereby
|
---|
| 967 | granted, provided that the above copyright notice appear in all
|
---|
| 968 | copies and that both that copyright notice and this permission
|
---|
| 969 | notice appear in supporting documentation. This software is
|
---|
| 970 | provided "as is" without express or implied warranty.
|
---|
| 971 | <p> <p>See also <a href="#scale">scale</a>() and <a href="#mirror">mirror</a>().
|
---|
| 972 |
|
---|
| 973 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="smoothScale-2"></a>QImage::smoothScale ( const <a href="qsize.html">QSize</a> & s, <a href="qimage.html#ScaleMode-enum">ScaleMode</a> mode = ScaleFree ) const
|
---|
| 974 | </h3>
|
---|
| 975 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 976 | <p> The requested size of the image is <em>s</em>.
|
---|
| 977 |
|
---|
| 978 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="swapRGB"></a>QImage::swapRGB () const
|
---|
| 979 | </h3>
|
---|
| 980 | Returns a QImage in which the values of the red and blue
|
---|
| 981 | components of all pixels have been swapped, effectively converting
|
---|
| 982 | an RGB image to a BGR image. The original QImage is not changed.
|
---|
| 983 |
|
---|
| 984 | <h3 class=fn><a href="qimage.html#Endian-enum">Endian</a> <a name="systemBitOrder"></a>QImage::systemBitOrder ()<tt> [static]</tt>
|
---|
| 985 | </h3>
|
---|
| 986 | Determines the bit order of the display hardware. Returns
|
---|
| 987 | QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first).
|
---|
| 988 | <p> <p>See also <a href="#systemByteOrder">systemByteOrder</a>().
|
---|
| 989 |
|
---|
| 990 | <h3 class=fn><a href="qimage.html#Endian-enum">Endian</a> <a name="systemByteOrder"></a>QImage::systemByteOrder ()<tt> [static]</tt>
|
---|
| 991 | </h3>
|
---|
| 992 | Determines the host computer byte order. Returns
|
---|
| 993 | QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first).
|
---|
| 994 | <p> <p>See also <a href="#systemBitOrder">systemBitOrder</a>().
|
---|
| 995 |
|
---|
| 996 | <h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QImage::text ( const char * key, const char * lang = 0 ) const
|
---|
| 997 | </h3>
|
---|
| 998 | Returns the string recorded for the keyword <em>key</em> in language <em>lang</em>, or in a default language if <em>lang</em> is 0.
|
---|
| 999 |
|
---|
| 1000 | <h3 class=fn><a href="qstring.html">QString</a> <a name="text-2"></a>QImage::text ( const QImageTextKeyLang & kl ) const
|
---|
| 1001 | </h3>
|
---|
| 1002 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 1003 | <p> Returns the string recorded for the keyword and language <em>kl</em>.
|
---|
| 1004 |
|
---|
| 1005 | <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="textKeys"></a>QImage::textKeys () const
|
---|
| 1006 | </h3>
|
---|
| 1007 | Returns the keywords for which some texts are recorded.
|
---|
| 1008 | <p> Note that if you want to iterate over the list, you should iterate
|
---|
| 1009 | over a copy, e.g.
|
---|
| 1010 | <pre>
|
---|
| 1011 | <a href="qstringlist.html">QStringList</a> list = myImage.textKeys();
|
---|
| 1012 | QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
|
---|
| 1013 | while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
|
---|
| 1014 | myProcessing( *it );
|
---|
| 1015 | ++it;
|
---|
| 1016 | }
|
---|
| 1017 | </pre>
|
---|
| 1018 |
|
---|
| 1019 | <p> <p>See also <a href="#textList">textList</a>(), <a href="#text">text</a>(), <a href="#setText">setText</a>(), and <a href="#textLanguages">textLanguages</a>().
|
---|
| 1020 |
|
---|
| 1021 | <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="textLanguages"></a>QImage::textLanguages () const
|
---|
| 1022 | </h3>
|
---|
| 1023 | Returns the language identifiers for which some texts are
|
---|
| 1024 | recorded.
|
---|
| 1025 | <p> Note that if you want to iterate over the list, you should iterate
|
---|
| 1026 | over a copy, e.g.
|
---|
| 1027 | <pre>
|
---|
| 1028 | <a href="qstringlist.html">QStringList</a> list = myImage.textLanguages();
|
---|
| 1029 | QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
|
---|
| 1030 | while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
|
---|
| 1031 | myProcessing( *it );
|
---|
| 1032 | ++it;
|
---|
| 1033 | }
|
---|
| 1034 | </pre>
|
---|
| 1035 |
|
---|
| 1036 | <p> <p>See also <a href="#textList">textList</a>(), <a href="#text">text</a>(), <a href="#setText">setText</a>(), and <a href="#textKeys">textKeys</a>().
|
---|
| 1037 |
|
---|
| 1038 | <h3 class=fn><a href="qvaluelist.html">QValueList</a><QImageTextKeyLang> <a name="textList"></a>QImage::textList () const
|
---|
| 1039 | </h3>
|
---|
| 1040 | Returns a list of QImageTextKeyLang objects that enumerate all the
|
---|
| 1041 | texts key/language pairs set by <a href="#setText">setText</a>() for this image.
|
---|
| 1042 | <p> Note that if you want to iterate over the list, you should iterate
|
---|
| 1043 | over a copy, e.g.
|
---|
| 1044 | <pre>
|
---|
| 1045 | <a href="qvaluelist.html">QValueList</a><QImageTextKeyLang> list = myImage.textList();
|
---|
| 1046 | QValueList<QImageTextKeyLang>::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
|
---|
| 1047 | while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
|
---|
| 1048 | myProcessing( *it );
|
---|
| 1049 | ++it;
|
---|
| 1050 | }
|
---|
| 1051 | </pre>
|
---|
| 1052 |
|
---|
| 1053 |
|
---|
| 1054 | <h3 class=fn>bool <a name="valid"></a>QImage::valid ( int x, int y ) const
|
---|
| 1055 | </h3>
|
---|
| 1056 | Returns TRUE if ( <em>x</em>, <em>y</em> ) is a valid coordinate in the image;
|
---|
| 1057 | otherwise returns FALSE.
|
---|
| 1058 | <p> <p>See also <a href="#width">width</a>(), <a href="#height">height</a>(), and <a href="#pixelIndex">pixelIndex</a>().
|
---|
| 1059 |
|
---|
| 1060 | <p>Examples: <a href="canvas-example.html#x2934">canvas/canvas.cpp</a> and <a href="qmag-example.html#x1777">qmag/qmag.cpp</a>.
|
---|
| 1061 | <h3 class=fn>int <a name="width"></a>QImage::width () const
|
---|
| 1062 | </h3>
|
---|
| 1063 |
|
---|
| 1064 | <p> Returns the width of the image.
|
---|
| 1065 | <p> <p>See also <a href="#height">height</a>(), <a href="#size">size</a>(), and <a href="#rect">rect</a>().
|
---|
| 1066 |
|
---|
| 1067 | <p>Examples: <a href="canvas-example.html#x2935">canvas/canvas.cpp</a> and <a href="qglwidget.html#x2121">opengl/texture/gltexobj.cpp</a>.
|
---|
| 1068 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="xForm"></a>QImage::xForm ( const <a href="qwmatrix.html">QWMatrix</a> & matrix ) const
|
---|
| 1069 | </h3>
|
---|
| 1070 | Returns a copy of the image that is transformed using the
|
---|
| 1071 | <a href="qwmatrix.html#TransformationMode">transformation matrix</a>, <em>matrix</em>.
|
---|
| 1072 | <p> The transformation <em>matrix</em> is internally adjusted to compensate
|
---|
| 1073 | for unwanted translation, i.e. <a href="#xForm">xForm</a>() returns the smallest image
|
---|
| 1074 | that contains all the transformed points of the original image.
|
---|
| 1075 | <p> <p>See also <a href="#scale">scale</a>(), <a href="qpixmap.html#xForm">QPixmap::xForm</a>(), <a href="qpixmap.html#trueMatrix">QPixmap::trueMatrix</a>(), and <a href="qwmatrix.html">QWMatrix</a>.
|
---|
| 1076 |
|
---|
| 1077 | <hr><h2>Related Functions</h2>
|
---|
| 1078 | <h3 class=fn>void <a name="bitBlt"></a>bitBlt ( <a href="qimage.html">QImage</a> * dst, int dx, int dy, const <a href="qimage.html">QImage</a> * src, int sx, int sy, int sw, int sh, int conversion_flags )
|
---|
| 1079 | </h3>
|
---|
| 1080 |
|
---|
| 1081 | <p> Copies a block of pixels from <em>src</em> to <em>dst</em>. The pixels
|
---|
| 1082 | copied from source (src) are converted according to
|
---|
| 1083 | <em>conversion_flags</em> if it is incompatible with the destination
|
---|
| 1084 | (<em>dst</em>).
|
---|
| 1085 | <p> <em>sx</em>, <em>sy</em> is the top-left pixel in <em>src</em>, <em>dx</em>, <em>dy</em>
|
---|
| 1086 | is the top-left position in <em>dst</em> and <em>sw</em>, \sh is the
|
---|
| 1087 | size of the copied block.
|
---|
| 1088 | <p> The copying is clipped if areas outside <em>src</em> or <em>dst</em> are
|
---|
| 1089 | specified.
|
---|
| 1090 | <p> If <em>sw</em> is -1, it is adjusted to src->width(). Similarly, if <em>sh</em> is -1, it is adjusted to src->height().
|
---|
| 1091 | <p> Currently inefficient for non 32-bit images.
|
---|
| 1092 |
|
---|
| 1093 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-lt-lt"></a>operator<< ( <a href="qdatastream.html">QDataStream</a> & s, const <a href="qimage.html">QImage</a> & image )
|
---|
| 1094 | </h3>
|
---|
| 1095 |
|
---|
| 1096 | <p> Writes the image <em>image</em> to the stream <em>s</em> as a PNG image, or as a
|
---|
| 1097 | BMP image if the stream's version is 1.
|
---|
| 1098 | <p> Note that writing the stream to a file will not produce a valid image file.
|
---|
| 1099 | <p> <p>See also <a href="#save">QImage::save</a>() and <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 1100 |
|
---|
| 1101 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qdatastream.html">QDataStream</a> & s, <a href="qimage.html">QImage</a> & image )
|
---|
| 1102 | </h3>
|
---|
| 1103 |
|
---|
| 1104 | <p> Reads an image from the stream <em>s</em> and stores it in <em>image</em>.
|
---|
| 1105 | <p> <p>See also <a href="#load">QImage::load</a>() and <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 1106 |
|
---|
| 1107 | <!-- eof -->
|
---|
| 1108 | <hr><p>
|
---|
| 1109 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 1110 | Copyright © 1995-2007
|
---|
| 1111 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 1112 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 1113 | <td>Copyright © 2007
|
---|
| 1114 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 1115 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 1116 | </table></div></address></body>
|
---|
| 1117 | </html>
|
---|