<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qpicture.cpp --> <title>Qt 4.8: QPictureIO Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtgui.html">QtGui</a></li> <li>QPictureIO</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QPictureIO Class Reference</h1> <!-- $$$QPictureIO-brief --> <p>The QPictureIO class contains parameters for loading and saving pictures. <a href="#details">More...</a></p> <!-- @@@QPictureIO --> <pre class="cpp"> <span class="preprocessor">#include <QPictureIO></span></pre><p><b>This class is obsolete.</b> It is provided to keep old source code working. We strongly advise against using it in new code.</p> <ul> <li><a href="qpictureio-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#QPictureIO">QPictureIO</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#QPictureIO-2">QPictureIO</a></b> ( QIODevice * <i>ioDevice</i>, const char * <i>format</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#QPictureIO-3">QPictureIO</a></b> ( const QString & <i>fileName</i>, const char * <i>format</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#dtor.QPictureIO">~QPictureIO</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#description">description</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#fileName">fileName</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const char * </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#format">format</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> float </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#gamma">gamma</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QIODevice * </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#ioDevice">ioDevice</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const char * </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#parameters">parameters</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPicture & </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#picture">picture</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#quality">quality</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#read">read</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setDescription">setDescription</a></b> ( const QString & <i>description</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setFileName">setFileName</a></b> ( const QString & <i>fileName</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setFormat">setFormat</a></b> ( const char * <i>format</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setGamma">setGamma</a></b> ( float <i>gamma</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setIODevice">setIODevice</a></b> ( QIODevice * <i>ioDevice</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setParameters">setParameters</a></b> ( const char * <i>parameters</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setPicture">setPicture</a></b> ( const QPicture & <i>picture</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setQuality">setQuality</a></b> ( int <i>q</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#setStatus">setStatus</a></b> ( int <i>status</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#status">status</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#write">write</a></b> ()</td></tr> </table> <a name="static-public-members"></a> <h2>Static Public Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#defineIOHandler">defineIOHandler</a></b> ( const char * <i>format</i>, const char * <i>header</i>, const char * <i>flags</i>, picture_io_handler <i>readPicture</i>, picture_io_handler <i>writePicture</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QByteArray> </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#inputFormats">inputFormats</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QByteArray> </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#outputFormats">outputFormats</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#pictureFormat">pictureFormat</a></b> ( const QString & <i>fileName</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qpictureio.html#pictureFormat-2">pictureFormat</a></b> ( QIODevice * <i>d</i> )</td></tr> </table> <a name="details"></a> <!-- $$$QPictureIO-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QPictureIO class contains parameters for loading and saving pictures.</p> <p>QPictureIO contains a <a href="qiodevice.html">QIODevice</a> object that is used for picture data I/O. The programmer can install new picture file formats in addition to those that Qt provides.</p> <p>You don't normally need to use this class; <a href="qpicture.html#load">QPicture::load</a>(), <a href="qpicture.html#save">QPicture::save</a>().</p> </div> <p><b>See also </b><a href="qpicture.html">QPicture</a>, <a href="qpixmap.html">QPixmap</a>, and <a href="qfile.html">QFile</a>.</p> <!-- @@@QPictureIO --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QPictureIO[overload1]$$$QPictureIO --> <h3 class="fn"><a name="QPictureIO"></a>QPictureIO::<span class="name">QPictureIO</span> ()</h3> <p>Constructs a <a href="qpictureio.html" class="obsolete">QPictureIO</a> object with all parameters set to zero.</p> <!-- @@@QPictureIO --> <!-- $$$QPictureIO$$$QPictureIOQIODevice*constchar* --> <h3 class="fn"><a name="QPictureIO-2"></a>QPictureIO::<span class="name">QPictureIO</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>ioDevice</i>, const <span class="type">char</span> * <i>format</i> )</h3> <p>Constructs a <a href="qpictureio.html" class="obsolete">QPictureIO</a> object with the I/O device <i>ioDevice</i> and a <i>format</i> tag.</p> <!-- @@@QPictureIO --> <!-- $$$QPictureIO$$$QPictureIOconstQString&constchar* --> <h3 class="fn"><a name="QPictureIO-3"></a>QPictureIO::<span class="name">QPictureIO</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>fileName</i>, const <span class="type">char</span> * <i>format</i> )</h3> <p>Constructs a <a href="qpictureio.html" class="obsolete">QPictureIO</a> object with the file name <i>fileName</i> and a <i>format</i> tag.</p> <!-- @@@QPictureIO --> <!-- $$$~QPictureIO[overload1]$$$~QPictureIO --> <h3 class="fn"><a name="dtor.QPictureIO"></a>QPictureIO::<span class="name">~QPictureIO</span> ()</h3> <p>Destroys the object and all related data.</p> <!-- @@@~QPictureIO --> <!-- $$$defineIOHandler[overload1]$$$defineIOHandlerconstchar*constchar*constchar*picture_io_handlerpicture_io_handler --> <h3 class="fn"><a name="defineIOHandler"></a><span class="type">void</span> QPictureIO::<span class="name">defineIOHandler</span> ( const <span class="type">char</span> * <i>format</i>, const <span class="type">char</span> * <i>header</i>, const <span class="type">char</span> * <i>flags</i>, <span class="type">picture_io_handler</span> <i>readPicture</i>, <span class="type">picture_io_handler</span> <i>writePicture</i> )<tt> [static]</tt></h3> <p>Defines a picture I/O handler for the picture format called <i>format</i>, which is recognized using the regular expression defined in <i>header</i>, read using <i>readPicture</i> and written using <i>writePicture</i>.</p> <p><i>flags</i> is a string of single-character flags for this format. The only flag defined currently is T (upper case), so the only legal value for <i>flags</i> are "T" and the empty string. The "T" flag means that the picture file is a text file, and Qt should treat all newline conventions as equivalent. (XPM files and some PPM files are text files for example.)</p> <p><i>format</i> is used to select a handler to write a <a href="qpicture.html">QPicture</a>; <i>header</i> is used to select a handler to read an picture file.</p> <p>If <i>readPicture</i> is a null pointer, the <a href="qpictureio.html" class="obsolete">QPictureIO</a> will not be able to read pictures in <i>format</i>. If <i>writePicture</i> is a null pointer, the <a href="qpictureio.html" class="obsolete">QPictureIO</a> will not be able to write pictures in <i>format</i>. If both are null, the <a href="qpictureio.html" class="obsolete">QPictureIO</a> object is valid but useless.</p> <p>Example:</p> <pre class="cpp"> <span class="type">void</span> readSVG(<span class="type"><a href="qpictureio.html">QPictureIO</a></span> <span class="operator">*</span>picture) { <span class="comment">// read the picture using the picture->ioDevice()</span> } <span class="type">void</span> writeSVG(<span class="type"><a href="qpictureio.html">QPictureIO</a></span> <span class="operator">*</span>picture) { <span class="comment">// write the picture using the picture->ioDevice()</span> } <span class="comment">// add the SVG picture handler</span> <span class="comment">// ...</span></pre> <p>Before the regular expression test, all the 0 bytes in the file header are converted to 1 bytes. This is done because when Qt was ASCII-based, <a href="qregexp.html">QRegExp</a> could not handle 0 bytes in strings.</p> <p>The regexp is only applied on the first 14 bytes of the file.</p> <p>(Note that if one handlerIO supports writing a format and another supports reading it, Qt supports both reading and writing. If two handlers support the same operation, Qt chooses one arbitrarily.)</p> <!-- @@@defineIOHandler --> <!-- $$$description[overload1]$$$description --> <h3 class="fn"><a name="description"></a><span class="type"><a href="qstring.html">QString</a></span> QPictureIO::<span class="name">description</span> () const</h3> <p>Returns the picture description string.</p> <p><b>See also </b><a href="qpictureio.html#setDescription">setDescription</a>().</p> <!-- @@@description --> <!-- $$$fileName[overload1]$$$fileName --> <h3 class="fn"><a name="fileName"></a><span class="type"><a href="qstring.html">QString</a></span> QPictureIO::<span class="name">fileName</span> () const</h3> <p>Returns the file name currently set.</p> <p><b>See also </b><a href="qpictureio.html#setFileName">setFileName</a>().</p> <!-- @@@fileName --> <!-- $$$format[overload1]$$$format --> <h3 class="fn"><a name="format"></a>const <span class="type">char</span> * QPictureIO::<span class="name">format</span> () const</h3> <p>Returns the picture format string or 0 if no format has been explicitly set.</p> <p><b>See also </b><a href="qpictureio.html#setFormat">setFormat</a>().</p> <!-- @@@format --> <!-- $$$gamma[overload1]$$$gamma --> <h3 class="fn"><a name="gamma"></a><span class="type">float</span> QPictureIO::<span class="name">gamma</span> () const</h3> <p>Returns the gamma value at which the picture will be viewed.</p> <p><b>See also </b><a href="qpictureio.html#setGamma">setGamma</a>().</p> <!-- @@@gamma --> <!-- $$$inputFormats[overload1]$$$inputFormats --> <h3 class="fn"><a name="inputFormats"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type"><a href="qbytearray.html">QByteArray</a></span>> QPictureIO::<span class="name">inputFormats</span> ()<tt> [static]</tt></h3> <p>Returns a sorted list of picture formats that are supported for picture input.</p> <!-- @@@inputFormats --> <!-- $$$ioDevice[overload1]$$$ioDevice --> <h3 class="fn"><a name="ioDevice"></a><span class="type"><a href="qiodevice.html">QIODevice</a></span> * QPictureIO::<span class="name">ioDevice</span> () const</h3> <p>Returns the IO device currently set.</p> <p><b>See also </b><a href="qpictureio.html#setIODevice">setIODevice</a>().</p> <!-- @@@ioDevice --> <!-- $$$outputFormats[overload1]$$$outputFormats --> <h3 class="fn"><a name="outputFormats"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type"><a href="qbytearray.html">QByteArray</a></span>> QPictureIO::<span class="name">outputFormats</span> ()<tt> [static]</tt></h3> <p>Returns a sorted list of picture formats that are supported for picture output.</p> <!-- @@@outputFormats --> <!-- $$$parameters[overload1]$$$parameters --> <h3 class="fn"><a name="parameters"></a>const <span class="type">char</span> * QPictureIO::<span class="name">parameters</span> () const</h3> <p>Returns the picture's parameters string.</p> <p><b>See also </b><a href="qpictureio.html#setParameters">setParameters</a>().</p> <!-- @@@parameters --> <!-- $$$picture[overload1]$$$picture --> <h3 class="fn"><a name="picture"></a>const <span class="type"><a href="qpicture.html">QPicture</a></span> & QPictureIO::<span class="name">picture</span> () const</h3> <p>Returns the picture currently set.</p> <p><b>See also </b><a href="qpictureio.html#setPicture">setPicture</a>().</p> <!-- @@@picture --> <!-- $$$pictureFormat[overload1]$$$pictureFormatconstQString& --> <h3 class="fn"><a name="pictureFormat"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QPictureIO::<span class="name">pictureFormat</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>fileName</i> )<tt> [static]</tt></h3> <p>Returns a string that specifies the picture format of the file <i>fileName</i>, or null if the file cannot be read or if the format is not recognized.</p> <!-- @@@pictureFormat --> <!-- $$$pictureFormat$$$pictureFormatQIODevice* --> <h3 class="fn"><a name="pictureFormat-2"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QPictureIO::<span class="name">pictureFormat</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>d</i> )<tt> [static]</tt></h3> <p>This is an overloaded function.</p> <p>Returns a string that specifies the picture format of the picture read from IO device <i>d</i>, or 0 if the device cannot be read or if the format is not recognized.</p> <p>Make sure that <i>d</i> is at the right position in the device (for example, at the beginning of the file).</p> <p><b>See also </b><a href="qiodevice-qt3.html#at" class="compat">QIODevice::at</a>().</p> <!-- @@@pictureFormat --> <!-- $$$quality[overload1]$$$quality --> <h3 class="fn"><a name="quality"></a><span class="type">int</span> QPictureIO::<span class="name">quality</span> () const</h3> <p>Returns the quality of the written picture, related to the compression ratio.</p> <p><b>See also </b><a href="qpictureio.html#setQuality">setQuality</a>() and <a href="qpicture.html#save">QPicture::save</a>().</p> <!-- @@@quality --> <!-- $$$read[overload1]$$$read --> <h3 class="fn"><a name="read"></a><span class="type">bool</span> QPictureIO::<span class="name">read</span> ()</h3> <p>Reads an picture into memory and returns true if the picture was successfully read; otherwise returns false.</p> <p>Before reading an picture you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used.</p> <p>Setting the picture file format string is optional.</p> <p>Note that this function does <i>not</i> set the <a href="qpictureio.html#format">format</a> used to read the picture. If you need that information, use the <a href="qpictureio.html#pictureFormat">pictureFormat</a>() static functions.</p> <p>Example:</p> <pre class="cpp"> <span class="type"><a href="qpictureio.html">QPictureIO</a></span> iio; <span class="type"><a href="qpixmap.html">QPixmap</a></span> pixmap; iio<span class="operator">.</span>setFileName(<span class="string">"vegeburger.pic"</span>); <span class="keyword">if</span> (iio<span class="operator">.</span>read()) { <span class="comment">// OK</span> <span class="type"><a href="qpicture.html">QPicture</a></span> picture <span class="operator">=</span> iio<span class="operator">.</span>picture(); <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="operator">&</span>pixmap); painter<span class="operator">.</span>drawPicture(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> picture); }</pre> <p><b>See also </b><a href="qpictureio.html#setIODevice">setIODevice</a>(), <a href="qpictureio.html#setFileName">setFileName</a>(), <a href="qpictureio.html#setFormat">setFormat</a>(), <a href="qpictureio.html#write">write</a>(), and <a href="qpixmap.html#load">QPixmap::load</a>().</p> <!-- @@@read --> <!-- $$$setDescription[overload1]$$$setDescriptionconstQString& --> <h3 class="fn"><a name="setDescription"></a><span class="type">void</span> QPictureIO::<span class="name">setDescription</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>description</i> )</h3> <p>Sets the picture description string for picture handlers that support picture descriptions to <i>description</i>.</p> <p>Currently, no picture format supported by Qt uses the description string.</p> <p><b>See also </b><a href="qpictureio.html#description">description</a>().</p> <!-- @@@setDescription --> <!-- $$$setFileName[overload1]$$$setFileNameconstQString& --> <h3 class="fn"><a name="setFileName"></a><span class="type">void</span> QPictureIO::<span class="name">setFileName</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>fileName</i> )</h3> <p>Sets the name of the file to read or write an picture from to <i>fileName</i>.</p> <p><b>See also </b><a href="qpictureio.html#fileName">fileName</a>() and <a href="qpictureio.html#setIODevice">setIODevice</a>().</p> <!-- @@@setFileName --> <!-- $$$setFormat[overload1]$$$setFormatconstchar* --> <h3 class="fn"><a name="setFormat"></a><span class="type">void</span> QPictureIO::<span class="name">setFormat</span> ( const <span class="type">char</span> * <i>format</i> )</h3> <p>Sets the picture format to <i>format</i> for the picture to be read or written.</p> <p>It is necessary to specify a format before writing an picture, but it is not necessary to specify a format before reading an picture.</p> <p>If no format has been set, Qt guesses the picture format before reading it. If a format is set the picture will only be read if it has that format.</p> <p><b>See also </b><a href="qpictureio.html#read">read</a>(), <a href="qpictureio.html#write">write</a>(), and <a href="qpictureio.html#format">format</a>().</p> <!-- @@@setFormat --> <!-- $$$setGamma[overload1]$$$setGammafloat --> <h3 class="fn"><a name="setGamma"></a><span class="type">void</span> QPictureIO::<span class="name">setGamma</span> ( <span class="type">float</span> <i>gamma</i> )</h3> <p>Sets the gamma value at which the picture will be viewed to <i>gamma</i>. If the picture format stores a gamma value for which the picture is intended to be used, then this setting will be used to modify the picture. Setting to 0.0 will disable gamma correction (i.e. any specification in the file will be ignored).</p> <p>The default value is 0.0.</p> <p><b>See also </b><a href="qpictureio.html#gamma">gamma</a>().</p> <!-- @@@setGamma --> <!-- $$$setIODevice[overload1]$$$setIODeviceQIODevice* --> <h3 class="fn"><a name="setIODevice"></a><span class="type">void</span> QPictureIO::<span class="name">setIODevice</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>ioDevice</i> )</h3> <p>Sets the IO device to be used for reading or writing an picture.</p> <p>Setting the IO device allows pictures to be read/written to any block-oriented <a href="qiodevice.html">QIODevice</a>.</p> <p>If <i>ioDevice</i> is not null, this IO device will override file name settings.</p> <p><b>See also </b><a href="qpictureio.html#setFileName">setFileName</a>().</p> <!-- @@@setIODevice --> <!-- $$$setParameters[overload1]$$$setParametersconstchar* --> <h3 class="fn"><a name="setParameters"></a><span class="type">void</span> QPictureIO::<span class="name">setParameters</span> ( const <span class="type">char</span> * <i>parameters</i> )</h3> <p>Sets the picture's parameter string to <i>parameters</i>. This is for picture handlers that require special parameters.</p> <p>Although the current picture formats supported by Qt ignore the parameters string, it may be used in future extensions or by contributions (for example, JPEG).</p> <p><b>See also </b><a href="qpictureio.html#parameters">parameters</a>().</p> <!-- @@@setParameters --> <!-- $$$setPicture[overload1]$$$setPictureconstQPicture& --> <h3 class="fn"><a name="setPicture"></a><span class="type">void</span> QPictureIO::<span class="name">setPicture</span> ( const <span class="type"><a href="qpicture.html">QPicture</a></span> & <i>picture</i> )</h3> <p>Sets the picture to <i>picture</i>.</p> <p><b>See also </b><a href="qpictureio.html#picture">picture</a>().</p> <!-- @@@setPicture --> <!-- $$$setQuality[overload1]$$$setQualityint --> <h3 class="fn"><a name="setQuality"></a><span class="type">void</span> QPictureIO::<span class="name">setQuality</span> ( <span class="type">int</span> <i>q</i> )</h3> <p>Sets the quality of the written picture to <i>q</i>, related to the compression ratio.</p> <p><i>q</i> must be in the range -1..100. Specify 0 to obtain small compressed files, 100 for large uncompressed files. (-1 signifies the default compression.)</p> <p><b>See also </b><a href="qpictureio.html#quality">quality</a>() and <a href="qpicture.html#save">QPicture::save</a>().</p> <!-- @@@setQuality --> <!-- $$$setStatus[overload1]$$$setStatusint --> <h3 class="fn"><a name="setStatus"></a><span class="type">void</span> QPictureIO::<span class="name">setStatus</span> ( <span class="type">int</span> <i>status</i> )</h3> <p>Sets the picture IO status to <i>status</i>. A non-zero value indicates an error, whereas 0 means that the IO operation was successful.</p> <p><b>See also </b><a href="qpictureio.html#status">status</a>().</p> <!-- @@@setStatus --> <!-- $$$status[overload1]$$$status --> <h3 class="fn"><a name="status"></a><span class="type">int</span> QPictureIO::<span class="name">status</span> () const</h3> <p>Returns the picture's IO status. A non-zero value indicates an error, whereas 0 means that the IO operation was successful.</p> <p><b>See also </b><a href="qpictureio.html#setStatus">setStatus</a>().</p> <!-- @@@status --> <!-- $$$write[overload1]$$$write --> <h3 class="fn"><a name="write"></a><span class="type">bool</span> QPictureIO::<span class="name">write</span> ()</h3> <p>Writes an picture to an IO device and returns true if the picture was successfully written; otherwise returns false.</p> <p>Before writing an picture you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used.</p> <p>The picture will be written using the specified picture format.</p> <p>Example:</p> <pre class="cpp"> <span class="type"><a href="qpictureio.html">QPictureIO</a></span> iio; <span class="type"><a href="qpicture.html">QPicture</a></span> picture; <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="operator">&</span>picture); painter<span class="operator">.</span>drawPixmap(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> pixmap); iio<span class="operator">.</span>setPicture(picture); iio<span class="operator">.</span>setFileName(<span class="string">"vegeburger.pic"</span>); iio<span class="operator">.</span>setFormat(<span class="string">"PIC"</span>); <span class="keyword">if</span> (iio<span class="operator">.</span>write()) <span class="keyword">return</span> <span class="keyword">true</span>; <span class="comment">// returned true if written successfully</span></pre> <p><b>See also </b><a href="qpictureio.html#setIODevice">setIODevice</a>(), <a href="qpictureio.html#setFileName">setFileName</a>(), <a href="qpictureio.html#setFormat">setFormat</a>(), <a href="qpictureio.html#read">read</a>(), and <a href="qpixmap.html#save">QPixmap::save</a>().</p> <!-- @@@write --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> 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.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>