<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qimage.cpp --> <title>Obsolete Members for QImage | Qt GUI 5.12.6</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QImage</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.12.6 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Obsolete Members for QImage</h1> <p><b>The following members of class <a href="qimage.html">QImage</a> are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p> <h2>Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QImage </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#alphaChannel">alphaChannel</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>int </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#byteCount">byteCount</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>int </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#numBytes">numBytes</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>int </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#numColors">numColors</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>int </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#serialNumber">serialNumber</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#setAlphaChannel">setAlphaChannel</a></b>(const QImage &<i>alphaChannel</i>)</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#setNumColors">setNumColors</a></b>(int <i>n</i>)</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#setText-1">setText</a></b>(const char *<i>key</i>, const char *<i>language</i>, const QString &<i>text</i>)</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QString </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#text-1">text</a></b>(const char *<i>key</i>, const char *<i>language</i> = nullptr) const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QString </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#text-2">text</a></b>(const QImageTextKeyLang &<i>keywordAndLanguage</i>) const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QStringList </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#textLanguages">textLanguages</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QList<QImageTextKeyLang> </td><td class="memItemRight bottomAlign"><b><a href="qimage-obsolete.html#textList">textList</a></b>() const</td></tr> </table></div> <h2>Member Function Documentation</h2> <!-- $$$alphaChannel[overload1]$$$alphaChannel --> <h3 class="fn" id="alphaChannel"><a name="alphaChannel"></a><span class="type"><a href="qimage.html#QImage">QImage</a></span> QImage::<span class="name">alphaChannel</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the alpha channel of the image as a new grayscale <a href="qimage.html">QImage</a> in which each pixel's red, green, and blue values are given the alpha value of the original image. The color depth of the returned image is 8-bit.</p> <p>You can see an example of use of this function in <a href="qpixmap.html">QPixmap</a>'s <a href="qpixmap.html#alphaChannel">alphaChannel()</a>, which works in the same way as this function on QPixmaps.</p> <p>Most usecases for this function can be replaced with <a href="qpainter.html">QPainter</a> and using composition modes.</p> <p>Note this returns a color-indexed image if you want the alpha channel in the alpha8 format instead use <a href="qimage.html#convertToFormat">convertToFormat</a>(<a href="qimage.html#Format-enum">Format_Alpha8</a>) on the source image.</p> <p><b>Warning:</b> This is an expensive function.</p> <p><b>See also </b><a href="qimage-obsolete.html#setAlphaChannel">setAlphaChannel</a>(), <a href="qimage.html#hasAlphaChannel">hasAlphaChannel</a>(), <a href="qimage.html#convertToFormat">convertToFormat</a>(), <a href="qpixmap.html#pixmap-information">Pixmap</a>, and <a href="qimage.html#image-transformations">Image Transformations</a>.</p> <!-- @@@alphaChannel --> <!-- $$$byteCount[overload1]$$$byteCount --> <h3 class="fn" id="byteCount"><a name="byteCount"></a><span class="type">int</span> QImage::<span class="name">byteCount</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the number of bytes occupied by the image data.</p> <p>Note this method should never be called on an image larger than 2 gigabytes. Instead use <a href="qimage.html#sizeInBytes">sizeInBytes</a>().</p> <p>This function was introduced in Qt 4.6.</p> <p><b>See also </b><a href="qimage.html#sizeInBytes">sizeInBytes</a>(), <a href="qimage.html#bytesPerLine">bytesPerLine</a>(), <a href="qimage.html#bits">bits</a>(), and <a href="qimage.html#image-information">Image Information</a>.</p> <!-- @@@byteCount --> <!-- $$$numBytes[overload1]$$$numBytes --> <h3 class="fn" id="numBytes"><a name="numBytes"></a><span class="type">int</span> QImage::<span class="name">numBytes</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the number of bytes occupied by the image data.</p> <p><b>See also </b><a href="qimage.html#sizeInBytes">sizeInBytes</a>().</p> <!-- @@@numBytes --> <!-- $$$numColors[overload1]$$$numColors --> <h3 class="fn" id="numColors"><a name="numColors"></a><span class="type">int</span> QImage::<span class="name">numColors</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the size of the color table for the image.</p> <p><b>See also </b><a href="qimage-obsolete.html#setNumColors">setNumColors</a>() and <a href="qimage.html#setColorCount">setColorCount</a>().</p> <!-- @@@numColors --> <!-- $$$serialNumber[overload1]$$$serialNumber --> <h3 class="fn" id="serialNumber"><a name="serialNumber"></a><span class="type">int</span> QImage::<span class="name">serialNumber</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns a number that identifies the contents of this <a href="qimage.html">QImage</a> object. Distinct <a href="qimage.html">QImage</a> objects can only have the same serial number if they refer to the same contents (but they don't have to).</p> <p>Use <a href="qimage.html#cacheKey">cacheKey</a>() instead.</p> <p><b>Warning:</b> The serial number doesn't necessarily change when the image is altered. This means that it may be dangerous to use it as a cache key.</p> <p><b>See also </b><a href="qimage.html#operator-eq-eq">operator==</a>().</p> <!-- @@@serialNumber --> <!-- $$$setAlphaChannel[overload1]$$$setAlphaChannelconstQImage& --> <h3 class="fn" id="setAlphaChannel"><a name="setAlphaChannel"></a><span class="type">void</span> QImage::<span class="name">setAlphaChannel</span>(const <span class="type"><a href="qimage.html#QImage">QImage</a></span> &<i>alphaChannel</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Sets the alpha channel of this image to the given <i>alphaChannel</i>.</p> <p>If <i>alphaChannel</i> is an 8 bit grayscale image, the intensity values are written into this buffer directly. Otherwise, <i>alphaChannel</i> is converted to 32 bit and the intensity of the RGB pixel values is used.</p> <p>Note that the image will be converted to the <a href="qimage.html#Format-enum">Format_ARGB32_Premultiplied</a> format if the function succeeds.</p> <p>Use one of the composition modes in <a href="qpainter.html#CompositionMode-enum">QPainter::CompositionMode</a> instead.</p> <p><b>Warning:</b> This function is expensive.</p> <p><b>See also </b><a href="qimage-obsolete.html#alphaChannel">alphaChannel</a>(), <a href="qimage.html#image-transformations">Image Transformations</a>, and <a href="qimage.html#image-formats">Image Formats</a>.</p> <!-- @@@setAlphaChannel --> <!-- $$$setNumColors[overload1]$$$setNumColorsint --> <h3 class="fn" id="setNumColors"><a name="setNumColors"></a><span class="type">void</span> QImage::<span class="name">setNumColors</span>(<span class="type">int</span> <i>n</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Resizes the color table to contain <i>n</i> entries.</p> <p><b>See also </b><a href="qimage-obsolete.html#numColors">numColors</a>() and <a href="qimage.html#setColorCount">setColorCount</a>().</p> <!-- @@@setNumColors --> <!-- $$$setText$$$setTextconstchar*constchar*constQString& --> <h3 class="fn" id="setText-1"><a name="setText-1"></a><span class="type">void</span> QImage::<span class="name">setText</span>(const <span class="type">char</span> *<i>key</i>, const <span class="type">char</span> *<i>language</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>text</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Sets the image text to the given <i>text</i> and associate it with the given <i>key</i>. The text is recorded in the specified <i>language</i>, or in a default language if <i>language</i> is 0.</p> <p>Use <a href="qimage.html#setText">setText</a>() instead.</p> <p>The language the text is recorded in is no longer relevant since the text is always set using <a href="../qtcore/qstring.html">QString</a> and UTF-8 representation.</p> <!-- @@@setText --> <!-- $$$text$$$textconstchar*constchar* --> <h3 class="fn" id="text-1"><a name="text-1"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QImage::<span class="name">text</span>(const <span class="type">char</span> *<i>key</i>, const <span class="type">char</span> *<i>language</i> = nullptr) const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the text recorded for the given <i>key</i> in the given <i>language</i>, or in a default language if <i>language</i> is 0.</p> <p>Use <a href="qimage.html#text">text</a>() instead.</p> <p>The language the text is recorded in is no longer relevant since the text is always set using <a href="../qtcore/qstring.html">QString</a> and UTF-8 representation.</p> <!-- @@@text --> <!-- $$$text$$$textconstQImageTextKeyLang& --> <h3 class="fn" id="text-2"><a name="text-2"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QImage::<span class="name">text</span>(const <span class="type">QImageTextKeyLang</span> &<i>keywordAndLanguage</i>) const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This is an overloaded function.</p> <p>Returns the text recorded for the given <i>keywordAndLanguage</i>.</p> <p>Use <a href="qimage.html#text">text</a>() instead.</p> <p>The language the text is recorded in is no longer relevant since the text is always set using <a href="../qtcore/qstring.html">QString</a> and UTF-8 representation.</p> <!-- @@@text --> <!-- $$$textLanguages[overload1]$$$textLanguages --> <h3 class="fn" id="textLanguages"><a name="textLanguages"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QImage::<span class="name">textLanguages</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the language identifiers for which some texts are recorded. Note that if you want to iterate over the list, you should iterate over a copy.</p> <p>The language the text is recorded in is no longer relevant since the text is always set using <a href="../qtcore/qstring.html">QString</a> and UTF-8 representation.</p> <p><b>See also </b><a href="qimage.html#textKeys">textKeys</a>().</p> <!-- @@@textLanguages --> <!-- $$$textList[overload1]$$$textList --> <h3 class="fn" id="textList"><a name="textList"></a><span class="type">QList</span><<span class="type">QImageTextKeyLang</span>> QImage::<span class="name">textList</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns a list of QImageTextKeyLang objects that enumerate all the texts key/language pairs set for this image.</p> <p>The language the text is recorded in is no longer relevant since the text is always set using <a href="../qtcore/qstring.html">QString</a> and UTF-8 representation.</p> <p><b>See also </b><a href="qimage.html#textKeys">textKeys</a>().</p> <!-- @@@textList --> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>