[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/qpixmap.cpp:53 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QPixmap 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>QPixmap Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QPixmap class is an off-screen, pixel-based paint device.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qpixmap-h.html">qpixmap.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qpaintdevice.html">QPaintDevice</a> and <a href="qt.html">Qt</a>.
|
---|
| 38 | <p>Inherited by <a href="qbitmap.html">QBitmap</a> and <a href="qcanvaspixmap.html">QCanvasPixmap</a>.
|
---|
| 39 | <p><a href="qpixmap-members.html">List of all member functions.</a>
|
---|
| 40 | <h2>Public Members</h2>
|
---|
| 41 | <ul>
|
---|
| 42 | <li class=fn>enum <a href="#ColorMode-enum"><b>ColorMode</b></a> { Auto, Color, Mono }</li>
|
---|
| 43 | <li class=fn>enum <a href="#Optimization-enum"><b>Optimization</b></a> { DefaultOptim, NoOptim, MemoryOptim = NoOptim, NormalOptim, BestOptim }</li>
|
---|
| 44 | <li class=fn><a href="#QPixmap"><b>QPixmap</b></a> ()</li>
|
---|
| 45 | <li class=fn><a href="#QPixmap-2"><b>QPixmap</b></a> ( const QImage & image )</li>
|
---|
| 46 | <li class=fn><a href="#QPixmap-3"><b>QPixmap</b></a> ( int w, int h, int depth = -1, Optimization optimization = DefaultOptim )</li>
|
---|
| 47 | <li class=fn><a href="#QPixmap-4"><b>QPixmap</b></a> ( const QSize & size, int depth = -1, Optimization optimization = DefaultOptim )</li>
|
---|
| 48 | <li class=fn><a href="#QPixmap-5"><b>QPixmap</b></a> ( const QString & fileName, const char * format = 0, ColorMode mode = Auto )</li>
|
---|
| 49 | <li class=fn><a href="#QPixmap-6"><b>QPixmap</b></a> ( const QString & fileName, const char * format, int conversion_flags )</li>
|
---|
| 50 | <li class=fn><a href="#QPixmap-7"><b>QPixmap</b></a> ( const char * xpm[] )</li>
|
---|
| 51 | <li class=fn><a href="#QPixmap-8"><b>QPixmap</b></a> ( const QByteArray & img_data )</li>
|
---|
| 52 | <li class=fn><a href="#QPixmap-9"><b>QPixmap</b></a> ( const QPixmap & pixmap )</li>
|
---|
| 53 | <li class=fn><a href="#~QPixmap"><b>~QPixmap</b></a> ()</li>
|
---|
| 54 | <li class=fn>QPixmap & <a href="#operator-eq"><b>operator=</b></a> ( const QPixmap & pixmap )</li>
|
---|
| 55 | <li class=fn>QPixmap & <a href="#operator-eq-2"><b>operator=</b></a> ( const QImage & image )</li>
|
---|
| 56 | <li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
|
---|
| 57 | <li class=fn>int <a href="#width"><b>width</b></a> () const</li>
|
---|
| 58 | <li class=fn>int <a href="#height"><b>height</b></a> () const</li>
|
---|
| 59 | <li class=fn>QSize <a href="#size"><b>size</b></a> () const</li>
|
---|
| 60 | <li class=fn>QRect <a href="#rect"><b>rect</b></a> () const</li>
|
---|
| 61 | <li class=fn>int <a href="#depth"><b>depth</b></a> () const</li>
|
---|
| 62 | <li class=fn>void <a href="#fill"><b>fill</b></a> ( const QColor & fillColor = Qt::white )</li>
|
---|
| 63 | <li class=fn>void <a href="#fill-2"><b>fill</b></a> ( const QWidget * widget, int xofs, int yofs )</li>
|
---|
| 64 | <li class=fn>void <a href="#fill-3"><b>fill</b></a> ( const QWidget * widget, const QPoint & ofs )</li>
|
---|
| 65 | <li class=fn>void <a href="#resize"><b>resize</b></a> ( int w, int h )</li>
|
---|
| 66 | <li class=fn>void <a href="#resize-2"><b>resize</b></a> ( const QSize & size )</li>
|
---|
| 67 | <li class=fn>const QBitmap * <a href="#mask"><b>mask</b></a> () const</li>
|
---|
| 68 | <li class=fn>void <a href="#setMask"><b>setMask</b></a> ( const QBitmap & newmask )</li>
|
---|
| 69 | <li class=fn>bool <a href="#selfMask"><b>selfMask</b></a> () const</li>
|
---|
| 70 | <li class=fn>bool <a href="#hasAlpha"><b>hasAlpha</b></a> () const</li>
|
---|
| 71 | <li class=fn>bool <a href="#hasAlphaChannel"><b>hasAlphaChannel</b></a> () const</li>
|
---|
| 72 | <li class=fn>QBitmap <a href="#createHeuristicMask"><b>createHeuristicMask</b></a> ( bool clipTight = TRUE ) const</li>
|
---|
| 73 | <li class=fn>QPixmap <a href="#xForm"><b>xForm</b></a> ( const QWMatrix & matrix ) const</li>
|
---|
| 74 | <li class=fn>QImage <a href="#convertToImage"><b>convertToImage</b></a> () const</li>
|
---|
| 75 | <li class=fn>bool <a href="#convertFromImage-2"><b>convertFromImage</b></a> ( const QImage & image, ColorMode mode = Auto )</li>
|
---|
| 76 | <li class=fn>bool <a href="#convertFromImage"><b>convertFromImage</b></a> ( const QImage & img, int conversion_flags )</li>
|
---|
| 77 | <li class=fn>bool <a href="#load-2"><b>load</b></a> ( const QString & fileName, const char * format = 0, ColorMode mode = Auto )</li>
|
---|
| 78 | <li class=fn>bool <a href="#load"><b>load</b></a> ( const QString & fileName, const char * format, int conversion_flags )</li>
|
---|
| 79 | <li class=fn>bool <a href="#loadFromData-2"><b>loadFromData</b></a> ( const uchar * buf, uint len, const char * format = 0, ColorMode mode = Auto )</li>
|
---|
| 80 | <li class=fn>bool <a href="#loadFromData"><b>loadFromData</b></a> ( const uchar * buf, uint len, const char * format, int conversion_flags )</li>
|
---|
| 81 | <li class=fn>bool <a href="#loadFromData-3"><b>loadFromData</b></a> ( const QByteArray & buf, const char * format = 0, int conversion_flags = 0 )</li>
|
---|
| 82 | <li class=fn>bool <a href="#save"><b>save</b></a> ( const QString & fileName, const char * format, int quality = -1 ) const</li>
|
---|
| 83 | <li class=fn>bool <a href="#save-2"><b>save</b></a> ( QIODevice * device, const char * format, int quality = -1 ) const</li>
|
---|
| 84 | <li class=fn>int <a href="#serialNumber"><b>serialNumber</b></a> () const</li>
|
---|
| 85 | <li class=fn>Optimization <a href="#optimization"><b>optimization</b></a> () const</li>
|
---|
| 86 | <li class=fn>void <a href="#setOptimization"><b>setOptimization</b></a> ( Optimization optimization )</li>
|
---|
| 87 | <li class=fn>virtual void <a href="#detach"><b>detach</b></a> ()</li>
|
---|
| 88 | <li class=fn>bool <a href="#isQBitmap"><b>isQBitmap</b></a> () const</li>
|
---|
| 89 | </ul>
|
---|
| 90 | <h2>Static Public Members</h2>
|
---|
| 91 | <ul>
|
---|
| 92 | <li class=fn>int <a href="#defaultDepth"><b>defaultDepth</b></a> ()</li>
|
---|
| 93 | <li class=fn>QPixmap <a href="#fromMimeSource"><b>fromMimeSource</b></a> ( const QString & abs_name )</li>
|
---|
| 94 | <li class=fn>QPixmap <a href="#grabWindow"><b>grabWindow</b></a> ( WId window, int x = 0, int y = 0, int w = -1, int h = -1 )</li>
|
---|
| 95 | <li class=fn>QPixmap <a href="#grabWidget"><b>grabWidget</b></a> ( QWidget * widget, int x = 0, int y = 0, int w = -1, int h = -1 )</li>
|
---|
| 96 | <li class=fn>QWMatrix <a href="#trueMatrix"><b>trueMatrix</b></a> ( const QWMatrix & matrix, int w, int h )</li>
|
---|
| 97 | <li class=fn>const char * <a href="#imageFormat"><b>imageFormat</b></a> ( const QString & fileName )</li>
|
---|
| 98 | <li class=fn>Optimization <a href="#defaultOptimization"><b>defaultOptimization</b></a> ()</li>
|
---|
| 99 | <li class=fn>void <a href="#setDefaultOptimization"><b>setDefaultOptimization</b></a> ( Optimization optimization )</li>
|
---|
| 100 | </ul>
|
---|
| 101 | <h2>Protected Members</h2>
|
---|
| 102 | <ul>
|
---|
| 103 | <li class=fn><a href="#QPixmap-a"><b>QPixmap</b></a> ( int w, int h, const uchar * bits, bool isXbitmap )</li>
|
---|
| 104 | <li class=fn>virtual int <a href="#metric"><b>metric</b></a> ( int m ) const</li>
|
---|
| 105 | </ul>
|
---|
| 106 | <h2>Related Functions</h2>
|
---|
| 107 | <ul>
|
---|
| 108 | <li class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QPixmap & pixmap )</li>
|
---|
| 109 | <li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QPixmap & pixmap )</li>
|
---|
| 110 | <li class=fn>void <a href="#copyBlt"><b>copyBlt</b></a> ( QPixmap * dst, int dx, int dy, const QPixmap * src, int sx, int sy, int sw, int sh )</li>
|
---|
| 111 | </ul>
|
---|
| 112 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | The QPixmap class is an off-screen, pixel-based paint device.
|
---|
| 116 | <p>
|
---|
| 117 |
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | <p> QPixmap is one of the two classes Qt provides for dealing with
|
---|
| 121 | images; the other is <a href="qimage.html">QImage</a>. QPixmap is designed and optimized
|
---|
| 122 | for drawing; QImage is designed and optimized for I/O and for
|
---|
| 123 | direct pixel access/manipulation. There are (slow) functions to
|
---|
| 124 | convert between QImage and QPixmap: <a href="#convertToImage">convertToImage</a>() and
|
---|
| 125 | <a href="#convertFromImage">convertFromImage</a>().
|
---|
| 126 | <p> One common use of the QPixmap class is to enable smooth updating
|
---|
| 127 | of widgets. Whenever something complex needs to be drawn, you can
|
---|
| 128 | use a pixmap to obtain flicker-free drawing, like this:
|
---|
| 129 | <p> <ol type=1>
|
---|
| 130 | <li> Create a pixmap with the same size as the widget.
|
---|
| 131 | <li> Fill the pixmap with the widget background color.
|
---|
| 132 | <li> Paint the pixmap.
|
---|
| 133 | <li> <a href="qpaintdevice.html#bitBlt">bitBlt</a>() the pixmap contents onto the widget.
|
---|
| 134 | </ol>
|
---|
| 135 | <p> Pixel data in a pixmap is internal and is managed by the
|
---|
| 136 | underlying window system. Pixels can be accessed only through
|
---|
| 137 | <a href="qpainter.html">QPainter</a> functions, through bitBlt(), and by converting the
|
---|
| 138 | QPixmap to a QImage.
|
---|
| 139 | <p> You can easily display a QPixmap on the screen using
|
---|
| 140 | <a href="qlabel.html#setPixmap">QLabel::setPixmap</a>(). For example, all the <a href="qbutton.html">QButton</a> subclasses
|
---|
| 141 | support pixmap use.
|
---|
| 142 | <p> The QPixmap class uses <a href="shclass.html">copy-on-write</a>,
|
---|
| 143 | so it is practical to pass QPixmap objects by value.
|
---|
| 144 | <p> You can retrieve the <a href="#width">width</a>(), <a href="#height">height</a>(), <a href="#depth">depth</a>() and <a href="#size">size</a>() of a
|
---|
| 145 | pixmap. The enclosing rectangle is given by <a href="#rect">rect</a>(). Pixmaps can be
|
---|
| 146 | filled with <a href="#fill">fill</a>() and resized with <a href="#resize">resize</a>(). You can create and
|
---|
| 147 | set a mask with <a href="#createHeuristicMask">createHeuristicMask</a>() and <a href="#setMask">setMask</a>(). Use
|
---|
| 148 | <a href="#selfMask">selfMask</a>() to see if the pixmap is identical to its mask.
|
---|
| 149 | <p> In addition to loading a pixmap from file using <a href="#load">load</a>() you can
|
---|
| 150 | also <a href="#loadFromData">loadFromData</a>(). You can control optimization with
|
---|
| 151 | <a href="#setOptimization">setOptimization</a>() and obtain a transformed version of the pixmap
|
---|
| 152 | using <a href="#xForm">xForm</a>()
|
---|
| 153 | <p> Note regarding Windows 95 and 98: on Windows 9x the system crashes
|
---|
| 154 | if you create more than about 1000 pixmaps, independent of the
|
---|
| 155 | size of the pixmaps or installed RAM. Windows NT-systems (including
|
---|
| 156 | 2000, XP and following versions) do not have the same limitation,
|
---|
| 157 | but depending on the graphics equipment the system will fail to
|
---|
| 158 | allocate pixmap objects at some point (due to system running out of
|
---|
| 159 | GDI resources).
|
---|
| 160 | <p> Qt tries to work around the resource limitation. If you set the
|
---|
| 161 | pixmap optimization to <a href="#Optimization-enum">QPixmap::MemoryOptim</a> and the width of
|
---|
| 162 | your pixmap is less than or equal to 128 pixels, Qt stores the
|
---|
| 163 | pixmap in a way that is very memory-efficient when there are many
|
---|
| 164 | pixmaps.
|
---|
| 165 | <p> If your application uses dozens or hundreds of pixmaps (for
|
---|
| 166 | example on tool bar buttons and in popup menus), and you plan to
|
---|
| 167 | run it on Windows 95 or Windows 98, we recommend using code like
|
---|
| 168 | this:
|
---|
| 169 | <p> <pre>
|
---|
| 170 | QPixmap::<a href="#setDefaultOptimization">setDefaultOptimization</a>( QPixmap::<a href="#Optimization-enum">MemoryOptim</a> );
|
---|
| 171 | while ( ... ) {
|
---|
| 172 | // load tool bar pixmaps etc.
|
---|
| 173 | QPixmap *pixmap = new QPixmap(fileName);
|
---|
| 174 | }
|
---|
| 175 | QPixmap::<a href="#setDefaultOptimization">setDefaultOptimization</a>( QPixmap::<a href="#Optimization-enum">NormalOptim</a> );
|
---|
| 176 | </pre>
|
---|
| 177 |
|
---|
| 178 | <p> In general it is recommended to make as much use of QPixmap's
|
---|
| 179 | <a href="shclass.html#implicit-sharing">implicit sharing</a> and the <a href="qpixmapcache.html">QPixmapCache</a> as possible.
|
---|
| 180 | <p> <p>See also <a href="qbitmap.html">QBitmap</a>, <a href="qimage.html">QImage</a>, <a href="qimageio.html">QImageIO</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>.
|
---|
| 181 |
|
---|
| 182 | <hr><h2>Member Type Documentation</h2>
|
---|
| 183 | <h3 class=fn><a name="ColorMode-enum"></a>QPixmap::ColorMode</h3>
|
---|
| 184 |
|
---|
| 185 | <p> This enum type defines the color modes that exist for converting
|
---|
| 186 | <a href="qimage.html">QImage</a> objects to QPixmap.
|
---|
| 187 | <ul>
|
---|
| 188 | <li><tt>QPixmap::Auto</tt> - Select <a href="#ColorMode-enum">Color</a> or <a href="#ColorMode-enum">Mono</a> on a case-by-case basis.
|
---|
| 189 | <li><tt>QPixmap::Color</tt> - Always create colored pixmaps.
|
---|
| 190 | <li><tt>QPixmap::Mono</tt> - Always create bitmaps.
|
---|
| 191 | </ul>
|
---|
| 192 | <h3 class=fn><a name="Optimization-enum"></a>QPixmap::Optimization</h3>
|
---|
| 193 |
|
---|
| 194 | <p> QPixmap has the choice of optimizing for speed or memory in a few
|
---|
| 195 | places; the best choice varies from pixmap to pixmap but can
|
---|
| 196 | generally be derived heuristically. This enum type defines a
|
---|
| 197 | number of optimization modes that you can set for any pixmap to
|
---|
| 198 | tweak the speed/memory tradeoffs:
|
---|
| 199 | <ul>
|
---|
| 200 | <li><tt>QPixmap::DefaultOptim</tt> - Whatever <a href="#defaultOptimization">QPixmap::defaultOptimization</a>()
|
---|
| 201 | returns. A pixmap with this optimization will have whatever
|
---|
| 202 | the current default optimization is. If the default
|
---|
| 203 | optimization is changed using <a href="#setDefaultOptimization">setDefaultOptimization</a>(), then
|
---|
| 204 | this will not effect any pixmaps that have already been
|
---|
| 205 | created.
|
---|
| 206 | <li><tt>QPixmap::NoOptim</tt> - No optimization (currently the same as <a href="#Optimization-enum">MemoryOptim</a>).
|
---|
| 207 | <li><tt>QPixmap::MemoryOptim</tt> - Optimize for minimal memory use on Windows
|
---|
| 208 | 9x and X11 systems.
|
---|
| 209 | <li><tt>QPixmap::NormalOptim</tt> - Optimize for typical usage. Often uses more
|
---|
| 210 | memory than <a href="#Optimization-enum">MemoryOptim</a>, and is often faster.
|
---|
| 211 | <li><tt>QPixmap::BestOptim</tt> - Optimize for pixmaps that are drawn very often
|
---|
| 212 | and where performance is critical. Generally uses more memory
|
---|
| 213 | than <a href="#Optimization-enum">NormalOptim</a> and may provide a little more speed.
|
---|
| 214 | </ul><p> We recommend using <a href="#Optimization-enum">DefaultOptim</a>.
|
---|
| 215 | <p>
|
---|
| 216 | <hr><h2>Member Function Documentation</h2>
|
---|
| 217 | <h3 class=fn><a name="QPixmap"></a>QPixmap::QPixmap ()
|
---|
| 218 | </h3>
|
---|
| 219 | Constructs a null pixmap.
|
---|
| 220 | <p> <p>See also <a href="#isNull">isNull</a>().
|
---|
| 221 |
|
---|
| 222 | <h3 class=fn><a name="QPixmap-2"></a>QPixmap::QPixmap ( const <a href="qimage.html">QImage</a> & image )
|
---|
| 223 | </h3>
|
---|
| 224 | Constructs a pixmap from the <a href="qimage.html">QImage</a> <em>image</em>.
|
---|
| 225 | <p> <p>See also <a href="#convertFromImage">convertFromImage</a>().
|
---|
| 226 |
|
---|
| 227 | <h3 class=fn><a name="QPixmap-3"></a>QPixmap::QPixmap ( int w, int h, int depth = -1, <a href="qpixmap.html#Optimization-enum">Optimization</a> optimization = DefaultOptim )
|
---|
| 228 | </h3>
|
---|
| 229 | Constructs a pixmap with <em>w</em> width, <em>h</em> height and <em>depth</em> bits
|
---|
| 230 | per pixel. The pixmap is optimized in accordance with the <em>optimization</em> value.
|
---|
| 231 | <p> The contents of the pixmap is uninitialized.
|
---|
| 232 | <p> The <em>depth</em> can be either 1 (monochrome) or the depth of the
|
---|
| 233 | current video mode. If <em>depth</em> is negative, then the hardware
|
---|
| 234 | depth of the current video mode will be used.
|
---|
| 235 | <p> If either <em>w</em> or <em>h</em> is zero, a null pixmap is constructed.
|
---|
| 236 | <p> <p>See also <a href="#isNull">isNull</a>() and <a href="#Optimization-enum">QPixmap::Optimization</a>.
|
---|
| 237 |
|
---|
| 238 | <h3 class=fn><a name="QPixmap-4"></a>QPixmap::QPixmap ( const <a href="qsize.html">QSize</a> & size, int depth = -1, <a href="qpixmap.html#Optimization-enum">Optimization</a> optimization = DefaultOptim )
|
---|
| 239 | </h3>
|
---|
| 240 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 241 | <p> Constructs a pixmap of size <em>size</em>, <em>depth</em> bits per pixel,
|
---|
| 242 | optimized in accordance with the <em>optimization</em> value.
|
---|
| 243 |
|
---|
| 244 | <h3 class=fn><a name="QPixmap-5"></a>QPixmap::QPixmap ( const <a href="qstring.html">QString</a> & fileName, const char * format = 0, <a href="qpixmap.html#ColorMode-enum">ColorMode</a> mode = Auto )
|
---|
| 245 | </h3>
|
---|
| 246 | Constructs a pixmap from the file <em>fileName</em>. If the file does
|
---|
| 247 | not exist or is of an unknown format, the pixmap becomes a null
|
---|
| 248 | pixmap.
|
---|
| 249 | <p> The <em>fileName</em>, <em>format</em> and <em>mode</em> parameters are passed on to
|
---|
| 250 | <a href="#load">load</a>(). This means that the data in <em>fileName</em> is not compiled
|
---|
| 251 | into the binary. If <em>fileName</em> contains a relative path (e.g. the
|
---|
| 252 | filename only) the relevant file must be found relative to the
|
---|
| 253 | runtime working directory.
|
---|
| 254 | <p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>, <a href="#isNull">isNull</a>(), <a href="#load">load</a>(), <a href="#loadFromData">loadFromData</a>(), <a href="#save">save</a>(), and <a href="#imageFormat">imageFormat</a>().
|
---|
| 255 |
|
---|
| 256 | <h3 class=fn><a name="QPixmap-6"></a>QPixmap::QPixmap ( const <a href="qstring.html">QString</a> & fileName, const char * format, int conversion_flags )
|
---|
| 257 | </h3>
|
---|
| 258 | Constructs a pixmap from the file <em>fileName</em>. If the file does
|
---|
| 259 | not exist or is of an unknown format, the pixmap becomes a null
|
---|
| 260 | pixmap.
|
---|
| 261 | <p> The <em>fileName</em>, <em>format</em> and <em>conversion_flags</em> parameters are
|
---|
| 262 | passed on to <a href="#load">load</a>(). This means that the data in <em>fileName</em> is
|
---|
| 263 | not compiled into the binary. If <em>fileName</em> contains a relative
|
---|
| 264 | path (e.g. the filename only) the relevant file must be found
|
---|
| 265 | relative to the runtime working directory.
|
---|
| 266 | <p> If the image needs to be modified to fit in a lower-resolution
|
---|
| 267 | 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.
|
---|
| 268 | <p> <p>See also <a href="qt.html#ImageConversionFlags-enum">Qt::ImageConversionFlags</a>, <a href="#isNull">isNull</a>(), <a href="#load">load</a>(), <a href="#loadFromData">loadFromData</a>(), <a href="#save">save</a>(), and <a href="#imageFormat">imageFormat</a>().
|
---|
| 269 |
|
---|
| 270 | <h3 class=fn><a name="QPixmap-7"></a>QPixmap::QPixmap ( const char * xpm[] )
|
---|
| 271 | </h3>
|
---|
| 272 | Constructs a pixmap from <em>xpm</em>, which must be a valid XPM image.
|
---|
| 273 | <p> Errors are silently ignored.
|
---|
| 274 | <p> Note that it's possible to squeeze the XPM variable a little bit
|
---|
| 275 | by using an unusual declaration:
|
---|
| 276 | <p> <pre>
|
---|
| 277 | static const char * const start_xpm[]={
|
---|
| 278 | "16 15 8 1",
|
---|
| 279 | "a c #cec6bd",
|
---|
| 280 | ....
|
---|
| 281 | </pre>
|
---|
| 282 |
|
---|
| 283 | <p> The extra <tt>const</tt> makes the entire definition read-only, which is
|
---|
| 284 | slightly more efficient (for example, when the code is in a shared
|
---|
| 285 | library) and ROMable when the application is to be stored in ROM.
|
---|
| 286 | <p> In order to use that sort of declaration you must cast the
|
---|
| 287 | variable back to <tt>const char **</tt> when you create the QPixmap.
|
---|
| 288 |
|
---|
| 289 | <h3 class=fn><a name="QPixmap-8"></a>QPixmap::QPixmap ( const <a href="qbytearray.html">QByteArray</a> & img_data )
|
---|
| 290 | </h3>
|
---|
| 291 | Constructs a pixmaps by loading from <em>img_data</em>. The data can be
|
---|
| 292 | in any image format supported by Qt.
|
---|
| 293 | <p> <p>See also <a href="#loadFromData">loadFromData</a>().
|
---|
| 294 |
|
---|
| 295 | <h3 class=fn><a name="QPixmap-9"></a>QPixmap::QPixmap ( const <a href="qpixmap.html">QPixmap</a> & pixmap )
|
---|
| 296 | </h3>
|
---|
| 297 | Constructs a pixmap that is a copy of <em>pixmap</em>.
|
---|
| 298 |
|
---|
| 299 | <h3 class=fn><a name="QPixmap-a"></a>QPixmap::QPixmap ( int w, int h, const uchar * bits, bool isXbitmap )<tt> [protected]</tt>
|
---|
| 300 | </h3>
|
---|
| 301 | Constructs a monochrome pixmap, with width <em>w</em> and height <em>h</em>,
|
---|
| 302 | that is initialized with the data in <em>bits</em>. The <em>isXbitmap</em>
|
---|
| 303 | indicates whether the data is an X bitmap and defaults to FALSE.
|
---|
| 304 | This constructor is protected and used by the <a href="qbitmap.html">QBitmap</a> class.
|
---|
| 305 |
|
---|
| 306 | <h3 class=fn><a name="~QPixmap"></a>QPixmap::~QPixmap ()
|
---|
| 307 | </h3>
|
---|
| 308 | Destroys the pixmap.
|
---|
| 309 |
|
---|
| 310 | <h3 class=fn>bool <a name="convertFromImage"></a>QPixmap::convertFromImage ( const <a href="qimage.html">QImage</a> & img, int conversion_flags )
|
---|
| 311 | </h3>
|
---|
| 312 | Converts image <em>img</em> and sets this pixmap. Returns TRUE if
|
---|
| 313 | successful; otherwise returns FALSE.
|
---|
| 314 | <p> The <em>conversion_flags</em> argument is a bitwise-OR of the
|
---|
| 315 | <a href="qt.html#ImageConversionFlags-enum">Qt::ImageConversionFlags</a>. Passing 0 for <em>conversion_flags</em>
|
---|
| 316 | sets all the default options.
|
---|
| 317 | <p> Note that even though a QPixmap with depth 1 behaves much like a
|
---|
| 318 | <a href="qbitmap.html">QBitmap</a>, <a href="#isQBitmap">isQBitmap</a>() returns FALSE.
|
---|
| 319 | <p> If a pixmap with depth 1 is painted with color0 and color1 and
|
---|
| 320 | converted to an image, the pixels painted with color0 will produce
|
---|
| 321 | pixel index 0 in the image and those painted with color1 will
|
---|
| 322 | produce pixel index 1.
|
---|
| 323 | <p> <p>See also <a href="#convertToImage">convertToImage</a>(), <a href="#isQBitmap">isQBitmap</a>(), <a href="qimage.html#convertDepth">QImage::convertDepth</a>(), <a href="#defaultDepth">defaultDepth</a>(), and <a href="qimage.html#hasAlphaBuffer">QImage::hasAlphaBuffer</a>().
|
---|
| 324 |
|
---|
| 325 | <p>Examples: <a href="canvas-example.html#x2943">canvas/canvas.cpp</a> and <a href="themes-example.html#x228">themes/wood.cpp</a>.
|
---|
| 326 | <h3 class=fn>bool <a name="convertFromImage-2"></a>QPixmap::convertFromImage ( const <a href="qimage.html">QImage</a> & image, <a href="qpixmap.html#ColorMode-enum">ColorMode</a> mode = Auto )
|
---|
| 327 | </h3>
|
---|
| 328 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 329 | <p> Converts <em>image</em> and sets this pixmap using color mode <em>mode</em>.
|
---|
| 330 | Returns TRUE if successful; otherwise returns FALSE.
|
---|
| 331 | <p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>.
|
---|
| 332 |
|
---|
| 333 | <h3 class=fn><a href="qimage.html">QImage</a> <a name="convertToImage"></a>QPixmap::convertToImage () const
|
---|
| 334 | </h3>
|
---|
| 335 | Converts the pixmap to a <a href="qimage.html">QImage</a>. Returns a null image if it fails.
|
---|
| 336 | <p> If the pixmap has 1-bit depth, the returned image will also be 1
|
---|
| 337 | bit deep. If the pixmap has 2- to 8-bit depth, the returned image
|
---|
| 338 | has 8-bit depth. If the pixmap has greater than 8-bit depth, the
|
---|
| 339 | returned image has 32-bit depth.
|
---|
| 340 | <p> Note that for the moment, alpha masks on monochrome images are
|
---|
| 341 | ignored.
|
---|
| 342 | <p> <p>See also <a href="#convertFromImage">convertFromImage</a>().
|
---|
| 343 |
|
---|
| 344 | <p>Example: <a href="qmag-example.html#x1783">qmag/qmag.cpp</a>.
|
---|
| 345 | <h3 class=fn><a href="qbitmap.html">QBitmap</a> <a name="createHeuristicMask"></a>QPixmap::createHeuristicMask ( bool clipTight = TRUE ) const
|
---|
| 346 | </h3>
|
---|
| 347 | Creates and returns a heuristic mask for this pixmap. It works by
|
---|
| 348 | selecting a color from one of the corners and then chipping away
|
---|
| 349 | pixels of that color, starting at all the edges.
|
---|
| 350 | <p> The mask may not be perfect but it should be reasonable, so you
|
---|
| 351 | can do things such as the following:
|
---|
| 352 | <pre>
|
---|
| 353 | pm->setMask( pm->createHeuristicMask() );
|
---|
| 354 | </pre>
|
---|
| 355 |
|
---|
| 356 | <p> This function is slow because it involves transformation to a
|
---|
| 357 | <a href="qimage.html">QImage</a>, non-trivial computations and a transformation back to a
|
---|
| 358 | <a href="qbitmap.html">QBitmap</a>.
|
---|
| 359 | <p> If <em>clipTight</em> is TRUE the mask is just large enough to cover the
|
---|
| 360 | pixels; otherwise, the mask is larger than the data pixels.
|
---|
| 361 | <p> <p>See also <a href="qimage.html#createHeuristicMask">QImage::createHeuristicMask</a>().
|
---|
| 362 |
|
---|
| 363 | <h3 class=fn>int <a name="defaultDepth"></a>QPixmap::defaultDepth ()<tt> [static]</tt>
|
---|
| 364 | </h3>
|
---|
| 365 | Returns the default pixmap depth, i.e. the depth a pixmap gets if
|
---|
| 366 | -1 is specified.
|
---|
| 367 | <p> <p>See also <a href="#depth">depth</a>().
|
---|
| 368 |
|
---|
| 369 | <h3 class=fn><a href="qpixmap.html#Optimization-enum">Optimization</a> <a name="defaultOptimization"></a>QPixmap::defaultOptimization ()<tt> [static]</tt>
|
---|
| 370 | </h3>
|
---|
| 371 | Returns the default pixmap optimization setting.
|
---|
| 372 | <p> <p>See also <a href="#setDefaultOptimization">setDefaultOptimization</a>(), <a href="#setOptimization">setOptimization</a>(), and <a href="#optimization">optimization</a>().
|
---|
| 373 |
|
---|
| 374 | <h3 class=fn>int <a name="depth"></a>QPixmap::depth () const
|
---|
| 375 | </h3>
|
---|
| 376 |
|
---|
| 377 | <p> Returns the depth of the pixmap.
|
---|
| 378 | <p> The pixmap depth is also called bits per pixel (bpp) or bit planes
|
---|
| 379 | of a pixmap. A null pixmap has depth 0.
|
---|
| 380 | <p> <p>See also <a href="#defaultDepth">defaultDepth</a>(), <a href="#isNull">isNull</a>(), and <a href="qimage.html#convertDepth">QImage::convertDepth</a>().
|
---|
| 381 |
|
---|
| 382 | <h3 class=fn>void <a name="detach"></a>QPixmap::detach ()<tt> [virtual]</tt>
|
---|
| 383 | </h3>
|
---|
| 384 | This is a special-purpose function that detaches the pixmap from
|
---|
| 385 | shared pixmap data.
|
---|
| 386 | <p> A pixmap is automatically detached by Qt whenever its contents is
|
---|
| 387 | about to change. This is done in all QPixmap member functions
|
---|
| 388 | that modify the pixmap (<a href="#fill">fill</a>(), <a href="#resize">resize</a>(), <a href="#convertFromImage">convertFromImage</a>(),
|
---|
| 389 | <a href="#load">load</a>(), etc.), in <a href="qpaintdevice.html#bitBlt">bitBlt</a>() for the destination pixmap and in
|
---|
| 390 | <a href="qpainter.html#begin">QPainter::begin</a>() on a pixmap.
|
---|
| 391 | <p> It is possible to modify a pixmap without letting Qt know. You can
|
---|
| 392 | first obtain the system-dependent <a href="qpaintdevice.html#handle">handle</a>() and then call
|
---|
| 393 | system-specific functions (for instance, BitBlt under Windows)
|
---|
| 394 | that modify the pixmap contents. In such cases, you can call
|
---|
| 395 | <a href="#detach">detach</a>() to cut the pixmap loose from other pixmaps that share
|
---|
| 396 | data with this one.
|
---|
| 397 | <p> detach() returns immediately if there is just a single reference
|
---|
| 398 | or if the pixmap has not been initialized yet.
|
---|
| 399 |
|
---|
| 400 | <h3 class=fn>void <a name="fill"></a>QPixmap::fill ( const <a href="qcolor.html">QColor</a> & fillColor = Qt::white )
|
---|
| 401 | </h3>
|
---|
| 402 | Fills the pixmap with the color <em>fillColor</em>.
|
---|
| 403 |
|
---|
| 404 | <p>Examples: <a href="tutorial2-08.html#x2606">chart/setdataform.cpp</a>, <a href="desktop-example.html#x1742">desktop/desktop.cpp</a>, <a href="grapher-nsplugin-example.html#x2765">grapher/grapher.cpp</a>, <a href="hello-example.html#x1638">hello/hello.cpp</a>, <a href="tutorial1-10.html#x2358">t10/cannon.cpp</a>, <a href="themes-example.html#x292">themes/metal.cpp</a>, and <a href="xform-example.html#x1245">xform/xform.cpp</a>.
|
---|
| 405 | <h3 class=fn>void <a name="fill-2"></a>QPixmap::fill ( const <a href="qwidget.html">QWidget</a> * widget, int xofs, int yofs )
|
---|
| 406 | </h3>
|
---|
| 407 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 408 | <p> Fills the pixmap with the <em>widget</em>'s background color or pixmap.
|
---|
| 409 | If the background is empty, nothing is done. <em>xofs</em>, <em>yofs</em> is
|
---|
| 410 | an offset in the widget.
|
---|
| 411 |
|
---|
| 412 | <h3 class=fn>void <a name="fill-3"></a>QPixmap::fill ( const <a href="qwidget.html">QWidget</a> * widget, const <a href="qpoint.html">QPoint</a> & ofs )
|
---|
| 413 | </h3>
|
---|
| 414 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 415 | <p> Fills the pixmap with the <em>widget</em>'s background color or pixmap.
|
---|
| 416 | If the background is empty, nothing is done.
|
---|
| 417 | <p> The <em>ofs</em> point is an offset in the widget.
|
---|
| 418 | <p> The point <em>ofs</em> is a point in the widget's coordinate system. The
|
---|
| 419 | pixmap's top-left pixel will be mapped to the point <em>ofs</em> in the
|
---|
| 420 | widget. This is significant if the widget has a background pixmap;
|
---|
| 421 | otherwise the pixmap will simply be filled with the background
|
---|
| 422 | color of the widget.
|
---|
| 423 | <p> Example:
|
---|
| 424 | <pre>
|
---|
| 425 | void CuteWidget::paintEvent( <a href="qpaintevent.html">QPaintEvent</a> *e )
|
---|
| 426 | {
|
---|
| 427 | <a href="qrect.html">QRect</a> ur = e-><a href="qpaintevent.html#rect">rect</a>(); // rectangle to update
|
---|
| 428 | QPixmap pix( ur.<a href="qrect.html#size">size</a>() ); // Pixmap for double-buffering
|
---|
| 429 | pix.<a href="#fill">fill</a>( this, ur.<a href="qrect.html#topLeft">topLeft</a>() ); // fill with widget background
|
---|
| 430 |
|
---|
| 431 | <a href="qpainter.html">QPainter</a> p( &pix );
|
---|
| 432 | p.<a href="qpainter.html#translate">translate</a>( -ur.<a href="qrect.html#x">x</a>(), -ur.<a href="qrect.html#y">y</a>() ); // use widget coordinate system
|
---|
| 433 | // when drawing on pixmap
|
---|
| 434 | // ... draw on pixmap ...
|
---|
| 435 |
|
---|
| 436 | p.<a href="qpainter.html#end">end</a>();
|
---|
| 437 |
|
---|
| 438 | <a href="qpaintdevice.html#bitBlt">bitBlt</a>( this, ur.<a href="qrect.html#topLeft">topLeft</a>(), &pix );
|
---|
| 439 | }
|
---|
| 440 | </pre>
|
---|
| 441 |
|
---|
| 442 |
|
---|
| 443 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="fromMimeSource"></a>QPixmap::fromMimeSource ( const <a href="qstring.html">QString</a> & abs_name )<tt> [static]</tt>
|
---|
| 444 | </h3> Convenience function. Gets the data associated with the absolute
|
---|
| 445 | name <em>abs_name</em> from the default mime source factory and decodes it
|
---|
| 446 | to a pixmap.
|
---|
| 447 | <p> <p>See also <a href="qmimesourcefactory.html">QMimeSourceFactory</a>, <a href="qimage.html#fromMimeSource">QImage::fromMimeSource</a>(), and <a href="qimagedrag.html#decode">QImageDrag::decode</a>().
|
---|
| 448 |
|
---|
| 449 | <p>Example: <a href="qactiongroup.html#x2113">textedit/textedit.cpp</a>.
|
---|
| 450 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="grabWidget"></a>QPixmap::grabWidget ( <a href="qwidget.html">QWidget</a> * widget, int x = 0, int y = 0, int w = -1, int h = -1 )<tt> [static]</tt>
|
---|
| 451 | </h3>
|
---|
| 452 | Creates a pixmap and paints <em>widget</em> in it.
|
---|
| 453 | <p> If the <em>widget</em> has any children, then they are also painted in
|
---|
| 454 | the appropriate positions.
|
---|
| 455 | <p> If you specify <em>x</em>, <em>y</em>, <em>w</em> or <em>h</em>, only the rectangle you
|
---|
| 456 | specify is painted. The defaults are 0, 0 (top-left corner) and
|
---|
| 457 | -1,-1 (which means the entire widget).
|
---|
| 458 | <p> (If <em>w</em> is negative, the function copies everything to the right
|
---|
| 459 | border of the window. If <em>h</em> is negative, the function copies
|
---|
| 460 | everything to the bottom of the window.)
|
---|
| 461 | <p> If <em>widget</em> is 0, or if the rectangle defined by <em>x</em>, <em>y</em>, the
|
---|
| 462 | modified <em>w</em> and the modified <em>h</em> does not overlap the <em>widget</em>->rect(), this function will return a null QPixmap.
|
---|
| 463 | <p> This function actually asks <em>widget</em> to paint itself (and its
|
---|
| 464 | children to paint themselves). <a href="#grabWindow">QPixmap::grabWindow</a>() grabs pixels
|
---|
| 465 | off the screen, which is a bit faster and picks up <em>exactly</em>
|
---|
| 466 | what's on-screen. This function works by calling paintEvent() with
|
---|
| 467 | painter redirection turned on. If there are overlaying windows,
|
---|
| 468 | <a href="#grabWindow">grabWindow</a>() will see them, but not this function.
|
---|
| 469 | <p> If there is overlap, it returns a pixmap of the size you want,
|
---|
| 470 | containing a rendering of <em>widget</em>. If the rectangle you ask for
|
---|
| 471 | is a superset of <em>widget</em>, the areas outside <em>widget</em> are
|
---|
| 472 | covered with the widget's background.
|
---|
| 473 | <p> If an error occurs when trying to grab the widget, such as the
|
---|
| 474 | size of the widget being too large to fit in memory, an <a href="#isNull">isNull</a>()
|
---|
| 475 | pixmap is returned.
|
---|
| 476 | <p> <p>See also <a href="#grabWindow">grabWindow</a>(), <a href="qpainter.html#redirect">QPainter::redirect</a>(), and <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().
|
---|
| 477 |
|
---|
| 478 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="grabWindow"></a>QPixmap::grabWindow ( WId window, int x = 0, int y = 0, int w = -1, int h = -1 )<tt> [static]</tt>
|
---|
| 479 | </h3>
|
---|
| 480 | Grabs the contents of the window <em>window</em> and makes a pixmap out
|
---|
| 481 | of it. Returns the pixmap.
|
---|
| 482 | <p> The arguments <em>(x, y)</em> specify the offset in the window, whereas
|
---|
| 483 | <em>(w, h)</em> specify the width and height of the area to be copied.
|
---|
| 484 | <p> If <em>w</em> is negative, the function copies everything to the right
|
---|
| 485 | border of the window. If <em>h</em> is negative, the function copies
|
---|
| 486 | everything to the bottom of the window.
|
---|
| 487 | <p> Note that <a href="#grabWindow">grabWindow</a>() grabs pixels from the screen, not from the
|
---|
| 488 | window. If there is another window partially or entirely over the
|
---|
| 489 | one you grab, you get pixels from the overlying window, too.
|
---|
| 490 | <p> Note also that the mouse cursor is generally not grabbed.
|
---|
| 491 | <p> The reason we use a window identifier and not a <a href="qwidget.html">QWidget</a> is to
|
---|
| 492 | enable grabbing of windows that are not part of the application,
|
---|
| 493 | window system frames, and so on.
|
---|
| 494 | <p> <b>Warning:</b> Grabbing an area outside the screen is not safe in
|
---|
| 495 | general. This depends on the underlying window system.
|
---|
| 496 | <p> <b>Warning:</b> X11 only: If <em>window</em> is not the same depth as the root
|
---|
| 497 | window and another window partially or entirely obscures the one
|
---|
| 498 | you grab, you will <em>not</em> get pixels from the overlying window.
|
---|
| 499 | The contests of the obscured areas in the pixmap are undefined and
|
---|
| 500 | uninitialized.
|
---|
| 501 | <p> <p>See also <a href="#grabWidget">grabWidget</a>().
|
---|
| 502 |
|
---|
| 503 | <p>Example: <a href="qmag-example.html#x1784">qmag/qmag.cpp</a>.
|
---|
| 504 | <h3 class=fn>bool <a name="hasAlpha"></a>QPixmap::hasAlpha () const
|
---|
| 505 | </h3>
|
---|
| 506 | Returns TRUE this pixmap has an alpha channel or a mask.
|
---|
| 507 | <p> <p>See also <a href="#hasAlphaChannel">hasAlphaChannel</a>() and <a href="#mask">mask</a>().
|
---|
| 508 |
|
---|
| 509 | <h3 class=fn>bool <a name="hasAlphaChannel"></a>QPixmap::hasAlphaChannel () const
|
---|
| 510 | </h3>
|
---|
| 511 | Returns TRUE if the pixmap has an alpha channel; otherwise it
|
---|
| 512 | returns FALSE.
|
---|
| 513 | <p> NOTE: If the pixmap has a mask but not alpha channel, this
|
---|
| 514 | function returns FALSE.
|
---|
| 515 | <p> <p>See also <a href="#hasAlpha">hasAlpha</a>() and <a href="#mask">mask</a>().
|
---|
| 516 |
|
---|
| 517 | <h3 class=fn>int <a name="height"></a>QPixmap::height () const
|
---|
| 518 | </h3>
|
---|
| 519 |
|
---|
| 520 | <p> Returns the height of the pixmap.
|
---|
| 521 | <p> <p>See also <a href="#width">width</a>(), <a href="#size">size</a>(), and <a href="#rect">rect</a>().
|
---|
| 522 |
|
---|
| 523 | <p>Examples: <a href="desktop-example.html#x1743">desktop/desktop.cpp</a>, <a href="movies-example.html#x510">movies/main.cpp</a>, <a href="scribble-example.html#x921">scribble/scribble.cpp</a>, <a href="scrollview-example.html#x638">scrollview/scrollview.cpp</a>, <a href="tutorial1-10.html#x2359">t10/cannon.cpp</a>, and <a href="xform-example.html#x1246">xform/xform.cpp</a>.
|
---|
| 524 | <h3 class=fn>const char * <a name="imageFormat"></a>QPixmap::imageFormat ( const <a href="qstring.html">QString</a> & fileName )<tt> [static]</tt>
|
---|
| 525 | </h3>
|
---|
| 526 | 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 cannot
|
---|
| 527 | be recognized.
|
---|
| 528 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats.
|
---|
| 529 | <p> <p>See also <a href="#load">load</a>() and <a href="#save">save</a>().
|
---|
| 530 |
|
---|
| 531 | <h3 class=fn>bool <a name="isNull"></a>QPixmap::isNull () const
|
---|
| 532 | </h3>
|
---|
| 533 |
|
---|
| 534 | <p> Returns TRUE if this is a null pixmap; otherwise returns FALSE.
|
---|
| 535 | <p> A null pixmap has zero width, zero height and no contents. You
|
---|
| 536 | cannot draw in a null pixmap or <a href="qpaintdevice.html#bitBlt">bitBlt</a>() anything to it.
|
---|
| 537 | <p> Resizing an existing pixmap to (0, 0) makes a pixmap into a null
|
---|
| 538 | pixmap.
|
---|
| 539 | <p> <p>See also <a href="#resize">resize</a>().
|
---|
| 540 |
|
---|
| 541 | <p>Examples: <a href="movies-example.html#x511">movies/main.cpp</a>, <a href="qdir-example.html#x1834">qdir/qdir.cpp</a>, <a href="qmag-example.html#x1785">qmag/qmag.cpp</a>, and <a href="scrollview-example.html#x639">scrollview/scrollview.cpp</a>.
|
---|
| 542 | <h3 class=fn>bool <a name="isQBitmap"></a>QPixmap::isQBitmap () const
|
---|
| 543 | </h3>
|
---|
| 544 |
|
---|
| 545 | <p> Returns TRUE if this is a <a href="qbitmap.html">QBitmap</a>; otherwise returns FALSE.
|
---|
| 546 |
|
---|
| 547 | <h3 class=fn>bool <a name="load"></a>QPixmap::load ( const <a href="qstring.html">QString</a> & fileName, const char * format, int conversion_flags )
|
---|
| 548 | </h3>
|
---|
| 549 | Loads a pixmap from the file <em>fileName</em> at runtime. Returns TRUE
|
---|
| 550 | if successful; otherwise returns FALSE.
|
---|
| 551 | <p> If <em>format</em> is specified, the loader attempts to read the pixmap
|
---|
| 552 | using the specified format. If <em>format</em> is not specified
|
---|
| 553 | (default), the loader reads a few bytes from the header to guess
|
---|
| 554 | the file's format.
|
---|
| 555 | <p> See the <a href="#convertFromImage">convertFromImage</a>() documentation for a description of the
|
---|
| 556 | <em>conversion_flags</em> argument.
|
---|
| 557 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
|
---|
| 558 | explains how to add extra formats.
|
---|
| 559 | <p> <p>See also <a href="#loadFromData">loadFromData</a>(), <a href="#save">save</a>(), <a href="#imageFormat">imageFormat</a>(), <a href="qimage.html#load">QImage::load</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 560 |
|
---|
| 561 | <p>Examples: <a href="picture-example.html#x124">picture/picture.cpp</a>, <a href="scrollview-example.html#x640">scrollview/scrollview.cpp</a>, and <a href="xform-example.html#x1247">xform/xform.cpp</a>.
|
---|
| 562 | <h3 class=fn>bool <a name="load-2"></a>QPixmap::load ( const <a href="qstring.html">QString</a> & fileName, const char * format = 0, <a href="qpixmap.html#ColorMode-enum">ColorMode</a> mode = Auto )
|
---|
| 563 | </h3>
|
---|
| 564 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 565 | <p> Loads a pixmap from the file <em>fileName</em> at runtime.
|
---|
| 566 | <p> If <em>format</em> is specified, the loader attempts to read the pixmap
|
---|
| 567 | using the specified format. If <em>format</em> is not specified
|
---|
| 568 | (default), the loader reads a few bytes from the header to guess
|
---|
| 569 | the file's format.
|
---|
| 570 | <p> The <em>mode</em> is used to specify the color mode of the pixmap.
|
---|
| 571 | <p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>.
|
---|
| 572 |
|
---|
| 573 | <h3 class=fn>bool <a name="loadFromData"></a>QPixmap::loadFromData ( const uchar * buf, uint len, const char * format, int conversion_flags )
|
---|
| 574 | </h3>
|
---|
| 575 | Loads a pixmap from the binary data in <em>buf</em> (<em>len</em> bytes).
|
---|
| 576 | Returns TRUE if successful; otherwise returns FALSE.
|
---|
| 577 | <p> If <em>format</em> is specified, the loader attempts to read the pixmap
|
---|
| 578 | using the specified format. If <em>format</em> is not specified
|
---|
| 579 | (default), the loader reads a few bytes from the header to guess
|
---|
| 580 | the file's format.
|
---|
| 581 | <p> See the <a href="#convertFromImage">convertFromImage</a>() documentation for a description of the
|
---|
| 582 | <em>conversion_flags</em> argument.
|
---|
| 583 | <p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
|
---|
| 584 | explains how to add extra formats.
|
---|
| 585 | <p> <p>See also <a href="#load">load</a>(), <a href="#save">save</a>(), <a href="#imageFormat">imageFormat</a>(), <a href="qimage.html#loadFromData">QImage::loadFromData</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 586 |
|
---|
| 587 | <h3 class=fn>bool <a name="loadFromData-2"></a>QPixmap::loadFromData ( const uchar * buf, uint len, const char * format = 0, <a href="qpixmap.html#ColorMode-enum">ColorMode</a> mode = Auto )
|
---|
| 588 | </h3>
|
---|
| 589 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 590 | <p> Loads a pixmap from the binary data in <em>buf</em> (<em>len</em> bytes) using
|
---|
| 591 | color mode <em>mode</em>. Returns TRUE if successful; otherwise returns
|
---|
| 592 | FALSE.
|
---|
| 593 | <p> If <em>format</em> is specified, the loader attempts to read the pixmap
|
---|
| 594 | using the specified format. If <em>format</em> is not specified
|
---|
| 595 | (default), the loader reads a few bytes from the header to guess
|
---|
| 596 | the file's format.
|
---|
| 597 | <p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>.
|
---|
| 598 |
|
---|
| 599 | <h3 class=fn>bool <a name="loadFromData-3"></a>QPixmap::loadFromData ( const <a href="qbytearray.html">QByteArray</a> & buf, const char * format = 0, int conversion_flags = 0 )
|
---|
| 600 | </h3>
|
---|
| 601 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 602 | <p>
|
---|
| 603 | <h3 class=fn>const <a href="qbitmap.html">QBitmap</a> * <a name="mask"></a>QPixmap::mask () const
|
---|
| 604 | </h3>
|
---|
| 605 |
|
---|
| 606 | <p> Returns the mask bitmap, or 0 if no mask has been set.
|
---|
| 607 | <p> <p>See also <a href="#setMask">setMask</a>(), <a href="qbitmap.html">QBitmap</a>, and <a href="#hasAlpha">hasAlpha</a>().
|
---|
| 608 |
|
---|
| 609 | <h3 class=fn>int <a name="metric"></a>QPixmap::metric ( int m ) const<tt> [virtual protected]</tt>
|
---|
| 610 | </h3>
|
---|
| 611 | Internal implementation of the virtual QPaintDevice::metric() function.
|
---|
| 612 | <p> Use the <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> class instead.
|
---|
| 613 | <p> <em>m</em> is the metric to get.
|
---|
| 614 |
|
---|
| 615 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> & <a name="operator-eq"></a>QPixmap::operator= ( const <a href="qpixmap.html">QPixmap</a> & pixmap )
|
---|
| 616 | </h3>
|
---|
| 617 | Assigns the pixmap <em>pixmap</em> to this pixmap and returns a
|
---|
| 618 | reference to this pixmap.
|
---|
| 619 |
|
---|
| 620 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> & <a name="operator-eq-2"></a>QPixmap::operator= ( const <a href="qimage.html">QImage</a> & image )
|
---|
| 621 | </h3>
|
---|
| 622 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 623 | <p> Converts the image <em>image</em> to a pixmap that is assigned to this
|
---|
| 624 | pixmap. Returns a reference to the pixmap.
|
---|
| 625 | <p> <p>See also <a href="#convertFromImage">convertFromImage</a>().
|
---|
| 626 |
|
---|
| 627 | <h3 class=fn><a href="qpixmap.html#Optimization-enum">Optimization</a> <a name="optimization"></a>QPixmap::optimization () const
|
---|
| 628 | </h3>
|
---|
| 629 |
|
---|
| 630 | <p> Returns the optimization setting for this pixmap.
|
---|
| 631 | <p> The default optimization setting is <a href="#Optimization-enum">QPixmap::NormalOptim</a>. You
|
---|
| 632 | can change this setting in two ways:
|
---|
| 633 | <ul>
|
---|
| 634 | <li> Call <a href="#setDefaultOptimization">setDefaultOptimization</a>() to set the default optimization
|
---|
| 635 | for all new pixmaps.
|
---|
| 636 | <li> Call <a href="#setOptimization">setOptimization</a>() to set the optimization for individual
|
---|
| 637 | pixmaps.
|
---|
| 638 | </ul>
|
---|
| 639 | <p> <p>See also <a href="#setOptimization">setOptimization</a>(), <a href="#setDefaultOptimization">setDefaultOptimization</a>(), and <a href="#defaultOptimization">defaultOptimization</a>().
|
---|
| 640 |
|
---|
| 641 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="rect"></a>QPixmap::rect () const
|
---|
| 642 | </h3>
|
---|
| 643 |
|
---|
| 644 | <p> Returns the enclosing rectangle (0,0,width(),height()) of the pixmap.
|
---|
| 645 | <p> <p>See also <a href="#width">width</a>(), <a href="#height">height</a>(), and <a href="#size">size</a>().
|
---|
| 646 |
|
---|
| 647 | <h3 class=fn>void <a name="resize"></a>QPixmap::resize ( int w, int h )
|
---|
| 648 | </h3>
|
---|
| 649 | Resizes the pixmap to <em>w</em> width and <em>h</em> height. If either <em>w</em>
|
---|
| 650 | or <em>h</em> is 0, the pixmap becomes a null pixmap.
|
---|
| 651 | <p> If both <em>w</em> and <em>h</em> are greater than 0, a valid pixmap is
|
---|
| 652 | created. New pixels will be uninitialized (random) if the pixmap
|
---|
| 653 | is expanded.
|
---|
| 654 |
|
---|
| 655 | <p>Examples: <a href="desktop-example.html#x1744">desktop/desktop.cpp</a> and <a href="grapher-nsplugin-example.html#x2766">grapher/grapher.cpp</a>.
|
---|
| 656 | <h3 class=fn>void <a name="resize-2"></a>QPixmap::resize ( const <a href="qsize.html">QSize</a> & size )
|
---|
| 657 | </h3>
|
---|
| 658 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 659 | <p> Resizes the pixmap to size <em>size</em>.
|
---|
| 660 |
|
---|
| 661 | <h3 class=fn>bool <a name="save"></a>QPixmap::save ( const <a href="qstring.html">QString</a> & fileName, const char * format, int quality = -1 ) const
|
---|
| 662 | </h3>
|
---|
| 663 | Saves the pixmap to the file <em>fileName</em> using the image file
|
---|
| 664 | format <em>format</em> and a quality factor <em>quality</em>. <em>quality</em> must
|
---|
| 665 | be in the range [0,100] or -1. Specify 0 to obtain small
|
---|
| 666 | compressed files, 100 for large uncompressed files, and -1 to use
|
---|
| 667 | the default settings. Returns TRUE if successful; otherwise
|
---|
| 668 | returns FALSE.
|
---|
| 669 | <p> <p>See also <a href="#load">load</a>(), <a href="#loadFromData">loadFromData</a>(), <a href="#imageFormat">imageFormat</a>(), <a href="qimage.html#save">QImage::save</a>(), and <a href="qimageio.html">QImageIO</a>.
|
---|
| 670 |
|
---|
| 671 | <p>Example: <a href="qmag-example.html#x1786">qmag/qmag.cpp</a>.
|
---|
| 672 | <h3 class=fn>bool <a name="save-2"></a>QPixmap::save ( <a href="qiodevice.html">QIODevice</a> * device, const char * format, int quality = -1 ) const
|
---|
| 673 | </h3>
|
---|
| 674 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 675 | <p> This function writes a QPixmap to the <a href="qiodevice.html">QIODevice</a>, <em>device</em>. This
|
---|
| 676 | can be used, for example, to save a pixmap directly into a
|
---|
| 677 | QByteArray:
|
---|
| 678 | <pre>
|
---|
| 679 | QPixmap pixmap;
|
---|
| 680 | <a href="qbytearray.html">QByteArray</a> ba;
|
---|
| 681 | <a href="qbuffer.html">QBuffer</a> buffer( ba );
|
---|
| 682 | buffer.<a href="qiodevice.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> );
|
---|
| 683 | pixmap.<a href="#save">save</a>( &buffer, "PNG" ); // writes pixmap into ba in PNG format
|
---|
| 684 | </pre>
|
---|
| 685 |
|
---|
| 686 |
|
---|
| 687 | <h3 class=fn>bool <a name="selfMask"></a>QPixmap::selfMask () const
|
---|
| 688 | </h3>
|
---|
| 689 |
|
---|
| 690 | <p> Returns TRUE if the pixmap's mask is identical to the pixmap
|
---|
| 691 | itself; otherwise returns FALSE.
|
---|
| 692 | <p> <p>See also <a href="#mask">mask</a>().
|
---|
| 693 |
|
---|
| 694 | <h3 class=fn>int <a name="serialNumber"></a>QPixmap::serialNumber () const
|
---|
| 695 | </h3>
|
---|
| 696 |
|
---|
| 697 | <p> Returns a number that uniquely identifies the contents of this
|
---|
| 698 | QPixmap object. This means that multiple QPixmap objects can have
|
---|
| 699 | the same serial number as long as they refer to the same contents.
|
---|
| 700 | <p> An example of where this is useful is for caching QPixmaps.
|
---|
| 701 | <p> <p>See also <a href="qpixmapcache.html">QPixmapCache</a>.
|
---|
| 702 |
|
---|
| 703 | <h3 class=fn>void <a name="setDefaultOptimization"></a>QPixmap::setDefaultOptimization ( <a href="qpixmap.html#Optimization-enum">Optimization</a> optimization )<tt> [static]</tt>
|
---|
| 704 | </h3>
|
---|
| 705 | Sets the default pixmap optimization.
|
---|
| 706 | <p> All <em>new</em> pixmaps that are created will use this default
|
---|
| 707 | optimization. You may also set optimization for individual pixmaps
|
---|
| 708 | using the <a href="#setOptimization">setOptimization</a>() function.
|
---|
| 709 | <p> The initial default <em>optimization</em> setting is <tt>QPixmap::Normal</tt>.
|
---|
| 710 | <p> <p>See also <a href="#defaultOptimization">defaultOptimization</a>(), <a href="#setOptimization">setOptimization</a>(), and <a href="#optimization">optimization</a>().
|
---|
| 711 |
|
---|
| 712 | <h3 class=fn>void <a name="setMask"></a>QPixmap::setMask ( const <a href="qbitmap.html">QBitmap</a> & newmask )
|
---|
| 713 | </h3>
|
---|
| 714 | Sets a mask bitmap.
|
---|
| 715 | <p> The <em>newmask</em> bitmap defines the clip mask for this pixmap. Every
|
---|
| 716 | pixel in <em>newmask</em> corresponds to a pixel in this pixmap. Pixel
|
---|
| 717 | value 1 means opaque and pixel value 0 means transparent. The mask
|
---|
| 718 | must have the same size as this pixmap.
|
---|
| 719 | <p> <b>Warning:</b> Setting the mask on a pixmap will cause any alpha channel
|
---|
| 720 | data to be cleared. For example:
|
---|
| 721 | <pre>
|
---|
| 722 | QPixmap alpha( "image-with-alpha.png" );
|
---|
| 723 | QPixmap alphacopy = alpha;
|
---|
| 724 | alphacopy.<a href="#setMask">setMask</a>( *alphacopy.<a href="#mask">mask</a>() );
|
---|
| 725 | </pre>
|
---|
| 726 |
|
---|
| 727 | Now, alpha and alphacopy are visually different.
|
---|
| 728 | <p> Setting a <a href="#isNull">null</a> mask resets the mask.
|
---|
| 729 | <p> <p>See also <a href="#mask">mask</a>(), <a href="#createHeuristicMask">createHeuristicMask</a>(), and <a href="qbitmap.html">QBitmap</a>.
|
---|
| 730 |
|
---|
| 731 | <h3 class=fn>void <a name="setOptimization"></a>QPixmap::setOptimization ( <a href="qpixmap.html#Optimization-enum">Optimization</a> optimization )
|
---|
| 732 | </h3>
|
---|
| 733 | Sets pixmap drawing optimization for this pixmap.
|
---|
| 734 | <p> The <em>optimization</em> setting affects pixmap operations, in
|
---|
| 735 | particular drawing of transparent pixmaps (<a href="qpaintdevice.html#bitBlt">bitBlt</a>() a pixmap with
|
---|
| 736 | a mask set) and pixmap transformations (the <a href="#xForm">xForm</a>() function).
|
---|
| 737 | <p> Pixmap optimization involves keeping intermediate results in a
|
---|
| 738 | cache buffer and using the cache to speed up bitBlt() and xForm().
|
---|
| 739 | The cost is more memory consumption, up to twice as much as an
|
---|
| 740 | unoptimized pixmap.
|
---|
| 741 | <p> Use the <a href="#setDefaultOptimization">setDefaultOptimization</a>() to change the default
|
---|
| 742 | optimization for all new pixmaps.
|
---|
| 743 | <p> <p>See also <a href="#optimization">optimization</a>(), <a href="#setDefaultOptimization">setDefaultOptimization</a>(), and <a href="#defaultOptimization">defaultOptimization</a>().
|
---|
| 744 |
|
---|
| 745 | <p>Example: <a href="desktop-example.html#x1745">desktop/desktop.cpp</a>.
|
---|
| 746 | <h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QPixmap::size () const
|
---|
| 747 | </h3>
|
---|
| 748 |
|
---|
| 749 | <p> Returns the size of the pixmap.
|
---|
| 750 | <p> <p>See also <a href="#width">width</a>(), <a href="#height">height</a>(), and <a href="#rect">rect</a>().
|
---|
| 751 |
|
---|
| 752 | <p>Example: <a href="movies-example.html#x512">movies/main.cpp</a>.
|
---|
| 753 | <h3 class=fn><a href="qwmatrix.html">QWMatrix</a> <a name="trueMatrix"></a>QPixmap::trueMatrix ( const <a href="qwmatrix.html">QWMatrix</a> & matrix, int w, int h )<tt> [static]</tt>
|
---|
| 754 | </h3>
|
---|
| 755 | Returns the actual matrix used for transforming a pixmap with <em>w</em>
|
---|
| 756 | width and <em>h</em> height and matrix <em>matrix</em>.
|
---|
| 757 | <p> When transforming a pixmap with <a href="#xForm">xForm</a>(), the <a href="qwmatrix.html#TransformationMode">transformation matrix</a>
|
---|
| 758 | is internally adjusted to compensate for unwanted translation,
|
---|
| 759 | i.e. xForm() returns the smallest pixmap containing all
|
---|
| 760 | transformed points of the original pixmap.
|
---|
| 761 | <p> This function returns the modified matrix, which maps points
|
---|
| 762 | correctly from the original pixmap into the new pixmap.
|
---|
| 763 | <p> <p>See also <a href="#xForm">xForm</a>() and <a href="qwmatrix.html">QWMatrix</a>.
|
---|
| 764 |
|
---|
| 765 | <h3 class=fn>int <a name="width"></a>QPixmap::width () const
|
---|
| 766 | </h3>
|
---|
| 767 |
|
---|
| 768 | <p> Returns the width of the pixmap.
|
---|
| 769 | <p> <p>See also <a href="#height">height</a>(), <a href="#size">size</a>(), and <a href="#rect">rect</a>().
|
---|
| 770 |
|
---|
| 771 | <p>Examples: <a href="desktop-example.html#x1746">desktop/desktop.cpp</a>, <a href="movies-example.html#x513">movies/main.cpp</a>, <a href="scribble-example.html#x922">scribble/scribble.cpp</a>, <a href="scrollview-example.html#x641">scrollview/scrollview.cpp</a>, and <a href="xform-example.html#x1248">xform/xform.cpp</a>.
|
---|
| 772 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="xForm"></a>QPixmap::xForm ( const <a href="qwmatrix.html">QWMatrix</a> & matrix ) const
|
---|
| 773 | </h3>
|
---|
| 774 | Returns a copy of the pixmap that is transformed using <em>matrix</em>.
|
---|
| 775 | The original pixmap is not changed.
|
---|
| 776 | <p> The transformation <em>matrix</em> is internally adjusted to compensate
|
---|
| 777 | for unwanted translation, i.e. <a href="#xForm">xForm</a>() returns the smallest image
|
---|
| 778 | that contains all the transformed points of the original image.
|
---|
| 779 | <p> This function is slow because it involves transformation to a
|
---|
| 780 | <a href="qimage.html">QImage</a>, non-trivial computations and a transformation back to a
|
---|
| 781 | QPixmap.
|
---|
| 782 | <p> <p>See also <a href="#trueMatrix">trueMatrix</a>(), <a href="qwmatrix.html">QWMatrix</a>, <a href="qpainter.html#setWorldMatrix">QPainter::setWorldMatrix</a>(), and <a href="qimage.html#xForm">QImage::xForm</a>().
|
---|
| 783 |
|
---|
| 784 | <p>Examples: <a href="desktop-example.html#x1747">desktop/desktop.cpp</a>, <a href="fileiconview-example.html#x863">fileiconview/qfileiconview.cpp</a>, <a href="movies-example.html#x514">movies/main.cpp</a>, and <a href="qmag-example.html#x1787">qmag/qmag.cpp</a>.
|
---|
| 785 | <hr><h2>Related Functions</h2>
|
---|
| 786 | <h3 class=fn>void <a name="copyBlt"></a>copyBlt ( <a href="qpixmap.html">QPixmap</a> * dst, int dx, int dy, const <a href="qpixmap.html">QPixmap</a> * src, int sx, int sy, int sw, int sh )
|
---|
| 787 | </h3>
|
---|
| 788 |
|
---|
| 789 | <p> Copies a block of pixels from <em>src</em> to <em>dst</em>. The alpha channel
|
---|
| 790 | and mask data (if any) is also copied from <em>src</em>. NOTE: <em>src</em>
|
---|
| 791 | is <em>not</em> alpha blended or masked when copied to <em>dst</em>. Use
|
---|
| 792 | <a href="qpaintdevice.html#bitBlt">bitBlt</a>() or <a href="qpainter.html#drawPixmap">QPainter::drawPixmap</a>() to perform alpha blending or
|
---|
| 793 | masked drawing.
|
---|
| 794 | <p> <em>sx</em>, <em>sy</em> is the top-left pixel in <em>src</em> (0, 0 by default), <em>dx</em>, <em>dy</em> is the top-left position in <em>dst</em> and <em>sw</em>, \sh is the
|
---|
| 795 | size of the copied block (all of <em>src</em> by default).
|
---|
| 796 | <p> If <em>src</em>, <em>dst</em>, <em>sw</em> or <em>sh</em> is 0 (zero), <a href="#copyBlt">copyBlt</a>() does
|
---|
| 797 | nothing. If <em>sw</em> or <em>sh</em> is negative, copyBlt() copies starting
|
---|
| 798 | at <em>sx</em> (and respectively, <em>sy</em>) and ending at the right edge
|
---|
| 799 | (and respectively, the bottom edge) of <em>src</em>.
|
---|
| 800 | <p> copyBlt() does nothing if <em>src</em> and <em>dst</em> have different depths.
|
---|
| 801 |
|
---|
| 802 | <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="qpixmap.html">QPixmap</a> & pixmap )
|
---|
| 803 | </h3>
|
---|
| 804 |
|
---|
| 805 | <p> Writes the pixmap <em>pixmap</em> to the stream <em>s</em> as a PNG image.
|
---|
| 806 | <p> Note that writing the stream to a file will not produce a valid image file.
|
---|
| 807 | <p> <p>See also <a href="#save">QPixmap::save</a>() and <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 808 |
|
---|
| 809 | <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="qpixmap.html">QPixmap</a> & pixmap )
|
---|
| 810 | </h3>
|
---|
| 811 |
|
---|
| 812 | <p> Reads a pixmap from the stream <em>s</em> into the pixmap <em>pixmap</em>.
|
---|
| 813 | <p> <p>See also <a href="#load">QPixmap::load</a>() and <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 814 |
|
---|
| 815 | <!-- eof -->
|
---|
| 816 | <hr><p>
|
---|
| 817 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 818 | Copyright © 1995-2007
|
---|
| 819 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 820 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 821 | <td>Copyright © 2007
|
---|
| 822 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 823 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 824 | </table></div></address></body>
|
---|
| 825 | </html>
|
---|