Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1621

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qpixmap.cpp:51 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QPixmap Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<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>

<p>The QPixmap class is an off-screen, pixel-based paint device.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qpixmap-h.html">qpixmap.h</a>&gt;</tt>
<p>Inherits <a href="qpaintdevice.html">QPaintDevice</a> and <a href="qt.html">Qt</a>.
<p>Inherited by <a href="qbitmap.html">QBitmap</a> and <a href="qcanvaspixmap.html">QCanvasPixmap</a>.
<p><a href="qpixmap-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn>enum <a href="#ColorMode-enum"><b>ColorMode</b></a> { Auto, Color, Mono }</div></li>
<li><div class=fn>enum <a href="#Optimization-enum"><b>Optimization</b></a> { DefaultOptim, NoOptim, MemoryOptim = NoOptim, NormalOptim, BestOptim }</div></li>
<li><div class=fn><a href="#QPixmap"><b>QPixmap</b></a> ()</div></li>
<li><div class=fn><a href="#QPixmap-2"><b>QPixmap</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;image )</div></li>
<li><div class=fn><a href="#QPixmap-3"><b>QPixmap</b></a> ( int&nbsp;w, int&nbsp;h, int&nbsp;depth = -1, Optimization&nbsp;optimization = DefaultOptim )</div></li>
<li><div class=fn><a href="#QPixmap-4"><b>QPixmap</b></a> ( const&nbsp;QSize&nbsp;&amp;&nbsp;size, int&nbsp;depth = -1, Optimization&nbsp;optimization = DefaultOptim )</div></li>
<li><div class=fn><a href="#QPixmap-5"><b>QPixmap</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format = 0, ColorMode&nbsp;mode = Auto )</div></li>
<li><div class=fn><a href="#QPixmap-6"><b>QPixmap</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;conversion_flags )</div></li>
<li><div class=fn><a href="#QPixmap-7"><b>QPixmap</b></a> ( const&nbsp;char&nbsp;*&nbsp;xpm[] )</div></li>
<li><div class=fn><a href="#QPixmap-8"><b>QPixmap</b></a> ( const&nbsp;QByteArray&nbsp;&amp;&nbsp;img_data )</div></li>
<li><div class=fn><a href="#QPixmap-9"><b>QPixmap</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap )</div></li>
<li><div class=fn><a href="#~QPixmap"><b>~QPixmap</b></a> ()</div></li>
<li><div class=fn>QPixmap &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap )</div></li>
<li><div class=fn>QPixmap &amp; <a href="#operator-eq-2"><b>operator=</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;image )</div></li>
<li><div class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</div></li>
<li><div class=fn>int <a href="#width"><b>width</b></a> () const</div></li>
<li><div class=fn>int <a href="#height"><b>height</b></a> () const</div></li>
<li><div class=fn>QSize <a href="#size"><b>size</b></a> () const</div></li>
<li><div class=fn>QRect <a href="#rect"><b>rect</b></a> () const</div></li>
<li><div class=fn>int <a href="#depth"><b>depth</b></a> () const</div></li>
<li><div class=fn>void <a href="#fill"><b>fill</b></a> ( const&nbsp;QColor&nbsp;&amp;&nbsp;fillColor = Qt::white )</div></li>
<li><div class=fn>void <a href="#fill-2"><b>fill</b></a> ( const&nbsp;QWidget&nbsp;*&nbsp;widget, int&nbsp;xofs, int&nbsp;yofs )</div></li>
<li><div class=fn>void <a href="#fill-3"><b>fill</b></a> ( const&nbsp;QWidget&nbsp;*&nbsp;widget, const&nbsp;QPoint&nbsp;&amp;&nbsp;ofs )</div></li>
<li><div class=fn>void <a href="#resize"><b>resize</b></a> ( int&nbsp;w, int&nbsp;h )</div></li>
<li><div class=fn>void <a href="#resize-2"><b>resize</b></a> ( const&nbsp;QSize&nbsp;&amp;&nbsp;size )</div></li>
<li><div class=fn>const QBitmap * <a href="#mask"><b>mask</b></a> () const</div></li>
<li><div class=fn>void <a href="#setMask"><b>setMask</b></a> ( const&nbsp;QBitmap&nbsp;&amp;&nbsp;newmask )</div></li>
<li><div class=fn>bool <a href="#selfMask"><b>selfMask</b></a> () const</div></li>
<li><div class=fn>QBitmap <a href="#createHeuristicMask"><b>createHeuristicMask</b></a> ( bool&nbsp;clipTight = TRUE ) const</div></li>
<li><div class=fn>QPixmap <a href="#xForm"><b>xForm</b></a> ( const&nbsp;QWMatrix&nbsp;&amp;&nbsp;matrix ) const</div></li>
<li><div class=fn>QImage <a href="#convertToImage"><b>convertToImage</b></a> () const</div></li>
<li><div class=fn>bool <a href="#convertFromImage-2"><b>convertFromImage</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;image, ColorMode&nbsp;mode = Auto )</div></li>
<li><div class=fn>bool <a href="#convertFromImage"><b>convertFromImage</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;img, int&nbsp;conversion_flags )</div></li>
<li><div class=fn>bool <a href="#load-2"><b>load</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format = 0, ColorMode&nbsp;mode = Auto )</div></li>
<li><div class=fn>bool <a href="#load"><b>load</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;conversion_flags )</div></li>
<li><div class=fn>bool <a href="#loadFromData-2"><b>loadFromData</b></a> ( const&nbsp;uchar&nbsp;*&nbsp;buf, uint&nbsp;len, const&nbsp;char&nbsp;*&nbsp;format = 0, ColorMode&nbsp;mode = Auto )</div></li>
<li><div class=fn>bool <a href="#loadFromData"><b>loadFromData</b></a> ( const&nbsp;uchar&nbsp;*&nbsp;buf, uint&nbsp;len, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;conversion_flags )</div></li>
<li><div class=fn>bool <a href="#loadFromData-3"><b>loadFromData</b></a> ( const&nbsp;QByteArray&nbsp;&amp;&nbsp;buf, const&nbsp;char&nbsp;*&nbsp;format = 0, int&nbsp;conversion_flags = 0 )</div></li>
<li><div class=fn>bool <a href="#save"><b>save</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;quality = -1 ) const</div></li>
<li><div class=fn>int <a href="#serialNumber"><b>serialNumber</b></a> () const</div></li>
<li><div class=fn>Optimization <a href="#optimization"><b>optimization</b></a> () const</div></li>
<li><div class=fn>void <a href="#setOptimization"><b>setOptimization</b></a> ( Optimization&nbsp;optimization )</div></li>
<li><div class=fn>virtual void <a href="#detach"><b>detach</b></a> ()</div></li>
<li><div class=fn>bool <a href="#isQBitmap"><b>isQBitmap</b></a> () const</div></li>
<li><div class=fn>virtual QGfx * <b>graphicsContext</b> ( bool&nbsp;clip_children = TRUE ) const</div></li>
<li><div class=fn>virtual unsigned char * <b>scanLine</b> ( int ) const</div></li>
<li><div class=fn>virtual int <b>bytesPerLine</b> () const</div></li>
<li><div class=fn>QRgb * <b>clut</b> () const</div></li>
<li><div class=fn>int <b>numCols</b> () const</div></li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class=fn>int <a href="#defaultDepth"><b>defaultDepth</b></a> ()</div></li>
<li><div class=fn>QPixmap <a href="#grabWindow"><b>grabWindow</b></a> ( WId&nbsp;window, int&nbsp;x = 0, int&nbsp;y = 0, int&nbsp;w = -1, int&nbsp;h = -1 )</div></li>
<li><div class=fn>QPixmap <a href="#grabWidget"><b>grabWidget</b></a> ( QWidget&nbsp;*&nbsp;widget, int&nbsp;x = 0, int&nbsp;y = 0, int&nbsp;w = -1, int&nbsp;h = -1 )</div></li>
<li><div class=fn>QWMatrix <a href="#trueMatrix"><b>trueMatrix</b></a> ( const&nbsp;QWMatrix&nbsp;&amp;&nbsp;matrix, int&nbsp;w, int&nbsp;h )</div></li>
<li><div class=fn>const char * <a href="#imageFormat"><b>imageFormat</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName )</div></li>
<li><div class=fn>Optimization <a href="#defaultOptimization"><b>defaultOptimization</b></a> ()</div></li>
<li><div class=fn>void <a href="#setDefaultOptimization"><b>setDefaultOptimization</b></a> ( Optimization&nbsp;optimization )</div></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class=fn><a href="#QPixmap-a"><b>QPixmap</b></a> ( int&nbsp;w, int&nbsp;h, const&nbsp;uchar&nbsp;*&nbsp;bits, bool&nbsp;isXbitmap )</div></li>
<li><div class=fn>virtual int <a href="#metric"><b>metric</b></a> ( int&nbsp;m ) const</div></li>
</ul>
<h2>Related Functions</h2>
<ul>
<li><div class=fn>QDataStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( QDataStream&nbsp;&amp;&nbsp;s, const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap )</div></li>
<li><div class=fn>QDataStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( QDataStream&nbsp;&amp;&nbsp;s, QPixmap&nbsp;&amp;&nbsp;pixmap )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QPixmap class is an off-screen, pixel-based paint device.
<p> 


<p> QPixmap is one of the two classes Qt provides for dealing with images;
the other is <a href="qimage.html">QImage</a>.  QPixmap is designed and optimized for
drawing; QImage is designed and optimized for I/O and for direct
pixel access/manipulation.  There are (slow) functions to convert
between QImage and QPixmap: <a href="#convertToImage">convertToImage</a>() and <a href="#convertFromImage">convertFromImage</a>().
<p> One common use of the QPixmap class is to enable smooth updating of
widgets.  Whenever something complex needs to be drawn, you can use
a pixmap to obtain flicker-free drawing, like this:
<p> <ol type=1>
<li> Create a pixmap with the same size as the widget.
<li> Fill the pixmap with the widget background color.
<li> Paint the pixmap.
<li> <a href="qpaintdevice.html#bitBlt">bitBlt</a>() the pixmap contents onto the widget.
</ol>
<p> Pixel data in a pixmap is internal and is managed by the underlying
window system.  Pixels can be accessed only through <a href="qpainter.html">QPainter</a>
functions, through bitBlt(), and by converting the QPixmap to a
QImage.
<p> You can easily display a QPixmap on the screen using
<a href="qlabel.html#setPixmap">QLabel::setPixmap</a>(), for example, all the <a href="qbutton.html">QButton</a> subclasses support
pixmap use.
<p> The QPixmap class uses lazy copying, so it is practical to pass
QPixmap objects as arguments.
<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
pixmap. The enclosing rectangle is given by <a href="#rect">rect</a>(). Pixmaps can be
filled with <a href="#fill">fill</a>() and resized with <a href="#resize">resize</a>(). You can create and set
a mask with <a href="#createHeuristicMask">createHeuristicMask</a>() and <a href="#setMask">setMask</a>(). Use <a href="#selfMask">selfMask</a>() to
see if the pixmap is identical to its mask.
<p> In addition to loading a pixmap from file using <a href="#load">load</a>() you can also
<a href="#loadFromData">loadFromData</a>(). You can control optimization with <a href="#setOptimization">setOptimization</a>()
and obtain a transformed version of the pixmap using <a href="#xForm">xForm</a>()
<p> Note regarding Windows 95 and 98: on Windows 9x the system crashes
if you create more than about 1000 pixmaps, independent of the size
of the pixmaps or installed RAM.  Windows NT and 2000 do not have
this limitation.
<p> Qt tries to work around the resource limitation.  If you set the
pixmap optimization to <a href="#Optimization-enum">QPixmap::MemoryOptim</a> and the width of your
pixmap is less than or equal to 128 pixels, Qt stores the pixmap in
a way that is very memory-efficient when there are many pixmaps.
<p> If your application uses dozens or hundreds of pixmaps (for example on tool
bar buttons and in popup menus), and you plan to run it on Windows 95 or
Windows 98, we recommend using code like this:
<p> <pre>
    QPixmap::<a href="#setDefaultOptimization">setDefaultOptimization</a>( QPixmap::<a href="#Optimization-enum">MemoryOptim</a> );
    while ( ... ) {
      // load tool bar pixmaps etc.
      QPixmap *pixmap = new QPixmap(fileName);
    }
    QPixmap::<a href="#setDefaultOptimization">setDefaultOptimization</a>( QPixmap::<a href="#Optimization-enum">NormalOptim</a> );
  </pre>
 
<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> and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="ColorMode-enum"></a>QPixmap::ColorMode</h3> 
<p> This enum type defines the color modes that exist for converting
<a href="qimage.html">QImage</a> objects to QPixmap.  The current values are:
<ul>
<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.
<li><tt>QPixmap::Color</tt> - Always create colored pixmaps.
<li><tt>QPixmap::Mono</tt> - Always create bitmaps.
</ul>
<h3 class=fn><a name="Optimization-enum"></a>QPixmap::Optimization</h3> 
<p> QPixmap has the choice of optimizing for speed or memory in a
few places; the best choice varies from pixmap to pixmap but can
generally be derived heuristically.  This enum type defines a number
of optimization modes that you can set for any pixmap to tweak the
speed/memory tradeoffs:
<ul>
<li><tt>QPixmap::DefaultOptim</tt> - Whatever <a href="#defaultOptimization">QPixmap::defaultOptimization</a>()
returns.  A pixmap with this optimization will have whatever the current
default optimization is.  If the default optimization is changed using
setDefaultOptimization, then this will not effect any pixmaps that have
already been created.
<li><tt>QPixmap::NoOptim</tt> - No optimization (currently the same as <a href="#Optimization-enum">MemoryOptim</a>).
<li><tt>QPixmap::MemoryOptim</tt> - Optimize for minimal memory use.
<li><tt>QPixmap::NormalOptim</tt> - Optimize for typical usage.  Often uses more
memory than <a href="#Optimization-enum">MemoryOptim</a>, and is often faster.
<li><tt>QPixmap::BestOptim</tt> - Optimize for pixmaps that are drawn very often
and where performance is critical.  Generally uses more memory than
<a href="#Optimization-enum">NormalOptim</a> and may provide a little better speed.
</ul><p> We recommend using <a href="#Optimization-enum">DefaultOptim</a>.
<p> 
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QPixmap"></a>QPixmap::QPixmap ()
</h3>
Constructs a null pixmap.
<p>See also <a href="#isNull">isNull</a>().

<h3 class=fn><a name="QPixmap-2"></a>QPixmap::QPixmap ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;image )
</h3>
Constructs a pixmap from the <a href="qimage.html">QImage</a> <em>image</em>.
<p> <p>See also <a href="#convertFromImage">convertFromImage</a>().

<h3 class=fn><a name="QPixmap-3"></a>QPixmap::QPixmap ( int&nbsp;w, int&nbsp;h, int&nbsp;depth = -1, <a href="qpixmap.html#Optimization-enum">Optimization</a>&nbsp;optimization = DefaultOptim )
</h3>
Constructs a pixmap with <em>w</em> width, <em>h</em> height and <em>depth</em> bits per
pixel. The pixmap is optimized in accordance with the <em>optimization</em> value.
<p> The contents of the pixmap is uninitialized.
<p> The <em>depth</em> can be either 1 (monochrome) or the depth of the
current video mode.  If <em>depth</em> is negative, then the hardware
depth of the current video mode will be used.
<p> If either <em>w</em> or <em>h</em> is zero, a null pixmap is constructed.
<p> <p>See also <a href="#isNull">isNull</a>() and <a href="#Optimization-enum">QPixmap::Optimization</a>.

<h3 class=fn><a name="QPixmap-4"></a>QPixmap::QPixmap ( const&nbsp;<a href="qsize.html">QSize</a>&nbsp;&amp;&nbsp;size, int&nbsp;depth = -1, <a href="qpixmap.html#Optimization-enum">Optimization</a>&nbsp;optimization = DefaultOptim )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Constructs a pixmap of size <em>size</em>, <em>depth</em> bits per pixel,
optimized in accordance with the <em>optimization</em> value.
<p> 
<h3 class=fn><a name="QPixmap-5"></a>QPixmap::QPixmap ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format = 0, <a href="qpixmap.html#ColorMode-enum">ColorMode</a>&nbsp;mode = Auto )
</h3>
Constructs a pixmap from the file <em>fileName</em>. If the file does not
exist or is of an unknown format, the pixmap becomes a null pixmap.
<p> The <em>fileName</em>, <em>format</em> and <em>mode</em> parameters are passed on to
<a href="#load">load</a>(). This means that the data in <em>fileName</em> is not compiled into
the binary. If <em>fileName</em> contains a relative path (e.g. the
filename only) the relevant file must be found relative to the
runtime working directory.
<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>().

<h3 class=fn><a name="QPixmap-6"></a>QPixmap::QPixmap ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;conversion_flags )
</h3>
Constructs a pixmap from the file <em>fileName</em>. If the file does not
exist or is of an unknown format, the pixmap becomes a null pixmap.
<p> The <em>fileName</em>, <em>format</em> and <em>conversion_flags</em> parameters are
passed on to <a href="#load">load</a>().  This means that the data in <em>fileName</em> is not
compiled into the binary.  If <em>fileName</em> contains a relative path
(e.g. the filename only) the relevant file must be found relative
to the runtime working directory.
<p> If the image needs to be modified to fit in a lower-resolution
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.
<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>().

<h3 class=fn><a name="QPixmap-7"></a>QPixmap::QPixmap ( const&nbsp;char&nbsp;*&nbsp;xpm[] )
</h3>
Constructs a pixmap from <em>xpm</em>, which must be a valid XPM image.
<p> Errors are silently ignored.
<p> Note that it's possible to squeeze the XPM variable a little bit by
using an unusual declaration:
<p> <pre>
    static const char * const start_xpm[]={
        "16 15 8 1",
        "a c #cec6bd",
    ....
  </pre>
 
<p> The extra <tt>const</tt> makes the entire definition read-only, which is
slightly more efficient (for example, when the code is in a shared library)
and ROMable when the application is to be stored in ROM.
<p> In order to use that sort of declaration you must cast the variable
back to <tt>const char **</tt> when you create the
QPixmap.

<h3 class=fn><a name="QPixmap-8"></a>QPixmap::QPixmap ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;img_data )
</h3>
Constructs a pixmaps by loading from <em>img_data</em>.
The data can be in any image format supported by Qt.
<p> <p>See also <a href="#loadFromData">loadFromData</a>().

<h3 class=fn><a name="QPixmap-9"></a>QPixmap::QPixmap ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap )
</h3>
Constructs a pixmap that is a copy of <em>pixmap</em>.

<h3 class=fn><a name="QPixmap-a"></a>QPixmap::QPixmap ( int&nbsp;w, int&nbsp;h, const&nbsp;uchar&nbsp;*&nbsp;bits, bool&nbsp;isXbitmap )<tt> [protected]</tt>
</h3>
Constructs a monochrome pixmap, with width <em>w</em> and height <em>h</em>,
that is initialized with the data in <em>bits</em>. The <em>isXbitmap</em>
indicates whether the data is an X bitmap and defaults to FALSE.
This constructor is protected and used by the <a href="qbitmap.html">QBitmap</a> class.

<h3 class=fn><a name="~QPixmap"></a>QPixmap::~QPixmap ()
</h3>
Destroys the pixmap.

<h3 class=fn>bool <a name="convertFromImage"></a>QPixmap::convertFromImage ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;img, int&nbsp;conversion_flags )
</h3>
Converts image <em>img</em> and sets this pixmap. Returns TRUE if successful;
otherwise returns FALSE.
<p> The <em>conversion_flags</em> argument is a bitwise-OR of the
<a href="qt.html#ImageConversionFlags-enum">Qt::ImageConversionFlags</a>.
Passing 0 for <em>conversion_flags</em> gives all the default options.
<p> Note that even though a QPixmap with depth 1 behaves much like a
<a href="qbitmap.html">QBitmap</a>, <a href="#isQBitmap">isQBitmap</a>() returns FALSE.
<p> If a pixmap with depth 1 is painted with color0 and color1 and
converted to an image, the pixels painted with color0 will produce
pixel index 0 in the image and those painted with color1 will produce
pixel index 1.
<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>().

<p>Examples: <a href="canvas-example.html#x2543">canvas/canvas.cpp</a>, <a href="qtimage-nsplugin-example.html#x2443">qtimage/qtimage.cpp</a> and <a href="themes-example.html#x243">themes/wood.cpp</a>.
<h3 class=fn>bool <a name="convertFromImage-2"></a>QPixmap::convertFromImage ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;image, <a href="qpixmap.html#ColorMode-enum">ColorMode</a>&nbsp;mode = Auto )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Converts <em>image</em> and sets this pixmap using color mode <em>mode</em>.
Returns TRUE if successful; otherwise returns FALSE.
<p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>.

<h3 class=fn><a href="qimage.html">QImage</a> <a name="convertToImage"></a>QPixmap::convertToImage () const
</h3>
Converts the pixmap to a <a href="qimage.html">QImage</a>. Returns a null image if the operation
failed.
<p> If the pixmap has 1-bit depth, the returned image will also be 1
bit deep.  If the pixmap has 2- to 8-bit depth, the returned image
has 8-bit depth.  If the pixmap has greater than 8-bit depth, the
returned image has 32-bit depth.
<p> Note that for the moment, alpha masks on monochrome images are
ignored.
<p> <p>See also <a href="#convertFromImage">convertFromImage</a>().

<p>Example: <a href="qmag-example.html#x703">qmag/qmag.cpp</a>.
<h3 class=fn><a href="qbitmap.html">QBitmap</a> <a name="createHeuristicMask"></a>QPixmap::createHeuristicMask ( bool&nbsp;clipTight = TRUE ) const
</h3>
Creates and returns a heuristic mask for this pixmap. It works by
selecting a color from one of the corners and then chipping away pixels of
that color, starting at all the edges.
<p> The mask may not be perfect but it should be reasonable, so you can do
things such as the following:
<pre>
    pm-&gt;setMask( pm-&gt;createHeuristicMask() );
  </pre>
 
<p> This function is slow because it involves transformation to a <a href="qimage.html">QImage</a>,
non-trivial computations and a transformation back to a <a href="qbitmap.html">QBitmap</a>.
<p> If <em>clipTight</em> is TRUE the mask is just large enough to cover the
pixels; otherwise, the mask is larger than the data pixels.
<p> <p>See also <a href="qimage.html#createHeuristicMask">QImage::createHeuristicMask</a>().

<h3 class=fn>int <a name="defaultDepth"></a>QPixmap::defaultDepth ()<tt> [static]</tt>
</h3>
Returns the default pixmap depth, i.e., the depth a pixmap gets
if -1 is specified.
<p>See also <a href="#depth">depth</a>().

<h3 class=fn><a href="qpixmap.html#Optimization-enum">Optimization</a> <a name="defaultOptimization"></a>QPixmap::defaultOptimization ()<tt> [static]</tt>
</h3>
Returns the default pixmap optimization setting.
<p>See also <a href="#setDefaultOptimization">setDefaultOptimization</a>(), <a href="#setOptimization">setOptimization</a>() and <a href="#optimization">optimization</a>().

<h3 class=fn>int <a name="depth"></a>QPixmap::depth () const
</h3>

Returns the depth of the image.
<p> The pixmap depth is also called bits per pixel (bpp) or bit planes
of a pixmap.	A null pixmap has depth 0.
<p> <p>See also <a href="#defaultDepth">defaultDepth</a>(), <a href="#isNull">isNull</a>() and <a href="qimage.html#convertDepth">QImage::convertDepth</a>().

<h3 class=fn>void <a name="detach"></a>QPixmap::detach ()<tt> [virtual]</tt>
</h3>
This is a special-purpose function that detaches the pixmap from shared
pixmap data.
<p> A pixmap is automatically detached by Qt whenever its contents is about
to change.  This is done in all QPixmap member functions that modify the
pixmap (<a href="#fill">fill</a>(), <a href="#resize">resize</a>(), <a href="#convertFromImage">convertFromImage</a>(), <a href="#load">load</a>(), etc.), in <a href="qpaintdevice.html#bitBlt">bitBlt</a>()
for the destination pixmap and in <a href="qpainter.html#begin">QPainter::begin</a>() on a pixmap.
<p> It is possible to modify a pixmap without letting Qt know.
You can first obtain the system-dependent <a href="qpaintdevice.html#handle">handle</a>()
and then call system-specific functions (for instance, BitBlt under Windows)
that modify the pixmap contents.  In this case, you can call <a href="#detach">detach</a>()
to cut the pixmap loose from other pixmaps that share data with this one.
<p> detach() returns immediately if there is just a single reference or if
the pixmap has not been initialized yet.

<h3 class=fn>void <a name="fill"></a>QPixmap::fill ( const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;fillColor = Qt::white )
</h3>
Fills the pixmap with the color <em>fillColor</em>.

<p>Examples: <a href="aclock-example.html#x2071">aclock/aclock.cpp</a>, <a href="desktop-example.html#x1737">desktop/desktop.cpp</a>, <a href="grapher-nsplugin-example.html#x2617">grapher/grapher.cpp</a>, <a href="hello-example.html#x1465">hello/hello.cpp</a>, <a href="t10.html#x2171">t10/cannon.cpp</a>, <a href="themes-example.html#x309">themes/metal.cpp</a> and <a href="xform-example.html#x99">xform/xform.cpp</a>.
<h3 class=fn>void <a name="fill-2"></a>QPixmap::fill ( const&nbsp;<a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget, int&nbsp;xofs, int&nbsp;yofs )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Fills the pixmap with the <em>widget</em>'s background color or pixmap.
If the background is empty, nothing is done. <em>xofs</em>, <em>yofs</em> is an
offset in the widget.

<h3 class=fn>void <a name="fill-3"></a>QPixmap::fill ( const&nbsp;<a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget, const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;ofs )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Fills the pixmap with the <em>widget</em>'s background color or pixmap.
If the background is empty, nothing is done.
<p> The <em>ofs</em> point is an offset in the widget.
<p> The point <em>ofs</em> is a point in the widget's coordinate system. The
pixmap's top-left pixel will be mapped to the point <em>ofs</em> in the
widget. This is significant if the widget has a background pixmap;
otherwise the pixmap will simply be filled with the background color of
the widget.
<p> Example:
<pre>
void CuteWidget::paintEvent( <a href="qpaintevent.html">QPaintEvent</a> *e )
{
QRect ur = e-&gt;<a href="qpaintevent.html#rect">rect</a>();            // rectangle to update

QPixmap  pix( ur.size() );       // Pixmap for double-buffering

pix.fill( this, ur.topLeft() );  // fill with widget background

QPainter p( &amp;pix );
p.translate( -ur.x(), -ur.y() ); // use widget coordinate system
                                 // when drawing on pixmap
//    ... draw on pixmap ...

p.end();

<a href="qpaintdevice.html#bitBlt">bitBlt</a>( this, ur.topLeft(), &amp;pix );
}
</pre>
 

<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="grabWidget"></a>QPixmap::grabWidget ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget, int&nbsp;x = 0, int&nbsp;y = 0, int&nbsp;w = -1, int&nbsp;h = -1 )<tt> [static]</tt>
</h3>  Creates a pixmap and paints <em>widget</em> in it.
<p> If the <em>widget</em> has any children, then they are also painted in the
appropriate positions.
<p> If you specify <em>x</em>, <em>y</em>, <em>w</em> or <em>h</em>, only the rectangle you
specify is painted.  The defaults are 0, 0 (top-left corner) and
-1,-1 (which means the entire widget).
<p> (If <em>w</em> is negative, the function copies everything to the right
border of the window.  If <em>h</em> is negative, the function copies
everything to the bottom of the window.)
<p> If <em>widget</em> is 0, or if the rectangle defined by <em>x</em>, <em>y</em>, the
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.
<p> This function actually asks <em>widget</em> to paint itself (and its
children to paint themselves).  <a href="#grabWindow">QPixmap::grabWindow</a>() grabs pixels
off the screen, which is a bit faster and picks up <em>exactly</em> what's
on-screen.  This function works by calling paintEvent() with painter
redirection turned on. If there are overlaying windows, <a href="#grabWindow">grabWindow</a>()
will see them, but not this function.
<p> If there is overlap, it returns a pixmap of the size you want,
containing a rendering of <em>widget</em>.  If the rectangle you ask for
is a superset of <em>widget</em>, the areas outside <em>widget</em> are covered
with the widget's background.
<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>().

<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="grabWindow"></a>QPixmap::grabWindow ( WId&nbsp;window, int&nbsp;x = 0, int&nbsp;y = 0, int&nbsp;w = -1, int&nbsp;h = -1 )<tt> [static]</tt>
</h3>
Grabs the contents of the window <em>window</em> and makes a pixmap out of
it. Returns the pixmap.
<p> The arguments <em>(x, y)</em> specify the offset in the window, whereas
<em>(w, h)</em> specify the width and height of the area to be copied.
<p> If <em>w</em> is negative, the function copies everything to the right
border of the window.	 If <em>h</em> is negative, the function copies
everything to the bottom of the window.
<p> Note that grabWindows() grabs pixels from the screen, not from the
window. If there is another window partially or
entirely over the one you grab, you get pixels from the overlying
window, too.
<p> Note also that the mouse cursor is generally not grabbed.
<p> The reason we use a window identifier and not a <a href="qwidget.html">QWidget</a> is to enable
grabbing of windows that are not part of the application, window
system frames, and so on.
<p> <b>Warning:</b> Grabbing an area outside the screen is not safe in general.
This depends on the underlying window system.
<p> <p>See also <a href="#grabWidget">grabWidget</a>().

<p>Example: <a href="qmag-example.html#x704">qmag/qmag.cpp</a>.
<h3 class=fn>int <a name="height"></a>QPixmap::height () const
</h3>

Returns the height of the pixmap.
<p>See also <a href="#width">width</a>(), <a href="#size">size</a>() and <a href="#rect">rect</a>().

<p>Examples: <a href="desktop-example.html#x1738">desktop/desktop.cpp</a>, <a href="movies-example.html#x1097">movies/main.cpp</a>, <a href="qtimage-nsplugin-example.html#x2444">qtimage/qtimage.cpp</a>, <a href="scribble-example.html#x536">scribble/scribble.cpp</a>, <a href="scrollview-example.html#x491">scrollview/scrollview.cpp</a>, <a href="t10.html#x2172">t10/cannon.cpp</a> and <a href="xform-example.html#x100">xform/xform.cpp</a>.
<h3 class=fn>const char * <a name="imageFormat"></a>QPixmap::imageFormat ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName )<tt> [static]</tt>
</h3>
Returns a string that specifies the image format of the file <em>fileName</em>,
or null if the file cannot be read or if the format cannot be recognized.
<p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats.
<p> <p>See also <a href="#load">load</a>() and <a href="#save">save</a>().

<h3 class=fn>bool <a name="isNull"></a>QPixmap::isNull () const
</h3>

Returns TRUE if this is a null pixmap; otherwise returns FALSE.
<p> A null pixmap has zero width, zero height and no contents.
You cannot draw in a null pixmap or <a href="qpaintdevice.html#bitBlt">bitBlt</a>() anything to it.
<p> Resizing an existing pixmap to (0, 0) makes a pixmap into a null
pixmap.
<p> <p>See also <a href="#resize">resize</a>().

<p>Examples: <a href="movies-example.html#x1098">movies/main.cpp</a>, <a href="qdir-example.html#x792">qdir/qdir.cpp</a>, <a href="qmag-example.html#x705">qmag/qmag.cpp</a> and <a href="scrollview-example.html#x492">scrollview/scrollview.cpp</a>.
<h3 class=fn>bool <a name="isQBitmap"></a>QPixmap::isQBitmap () const
</h3>

Returns TRUE if this is a <a href="qbitmap.html">QBitmap</a>; otherwise returns FALSE.

<h3 class=fn>bool <a name="load"></a>QPixmap::load ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;conversion_flags )
</h3>
Loads a pixmap from the file <em>fileName</em> at runtime.
Returns TRUE if successful, or FALSE if the pixmap could not be loaded.
<p> If <em>format</em> is specified, the loader attempts to read the pixmap using the
specified format. If <em>format</em> is not specified (default),
the loader reads a few bytes from the header to guess the file's format.
<p> See the <a href="#convertFromImage">convertFromImage</a>() documentation for a description
of the <em>conversion_flags</em> argument.
<p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
explains how to add extra formats.
<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>.

<p>Examples: <a href="picture-example.html#x921">picture/picture.cpp</a>, <a href="scrollview-example.html#x493">scrollview/scrollview.cpp</a> and <a href="xform-example.html#x101">xform/xform.cpp</a>.
<h3 class=fn>bool <a name="load-2"></a>QPixmap::load ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format = 0, <a href="qpixmap.html#ColorMode-enum">ColorMode</a>&nbsp;mode = Auto )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Loads a pixmap from the file <em>fileName</em> at runtime.
<p> If <em>format</em> is specified, the loader attempts to read the pixmap using the
specified format. If <em>format</em> is not specified (default),
the loader reads a few bytes from the header to guess the file's format.
<p> The <em>mode</em> is used to specify the color mode of the pixmap.
<p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>.

<h3 class=fn>bool <a name="loadFromData"></a>QPixmap::loadFromData ( const&nbsp;uchar&nbsp;*&nbsp;buf, uint&nbsp;len, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;conversion_flags )
</h3>
Loads a pixmap from the binary data in <em>buf</em> (<em>len</em> bytes).
Returns TRUE if successful, or FALSE if the pixmap could not be loaded.
<p> If <em>format</em> is specified, the loader attempts to read the pixmap using the
specified format. If <em>format</em> is not specified (default),
the loader reads a few bytes from the header to guess the file's format.
<p> See the <a href="#convertFromImage">convertFromImage</a>() documentation for a description
of the <em>conversion_flags</em> argument.
<p> The <a href="qimageio.html">QImageIO</a> documentation lists the supported image formats and
explains how to add extra formats.
<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>.

<h3 class=fn>bool <a name="loadFromData-2"></a>QPixmap::loadFromData ( const&nbsp;uchar&nbsp;*&nbsp;buf, uint&nbsp;len, const&nbsp;char&nbsp;*&nbsp;format = 0, <a href="qpixmap.html#ColorMode-enum">ColorMode</a>&nbsp;mode = Auto )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Loads a pixmap from the binary data in <em>buf</em> (<em>len</em> bytes) using
color mode <em>mode</em>.
Returns TRUE if successful, or FALSE if the pixmap could not be loaded.
<p> If <em>format</em> is specified, the loader attempts to read the pixmap using the
specified format. If <em>format</em> is not specified (default),
the loader reads a few bytes from the header to guess the file's format.
<p> <p>See also <a href="#ColorMode-enum">QPixmap::ColorMode</a>.

<h3 class=fn>bool <a name="loadFromData-3"></a>QPixmap::loadFromData ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;buf, const&nbsp;char&nbsp;*&nbsp;format = 0, int&nbsp;conversion_flags = 0 )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> 
<h3 class=fn>const&nbsp;<a href="qbitmap.html">QBitmap</a>&nbsp;* <a name="mask"></a>QPixmap::mask () const
</h3>

Returns the mask bitmap, or null if no mask has been set.
<p> <p>See also <a href="#setMask">setMask</a>() and <a href="qbitmap.html">QBitmap</a>.

<h3 class=fn>int <a name="metric"></a>QPixmap::metric ( int&nbsp;m ) const<tt> [virtual protected]</tt>
</h3>
Internal implementation of the virtual <a href="qpaintdevice.html#metric">QPaintDevice::metric</a>() function.
<p> Use the <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> class instead.
<p> <em>m</em> is the metric to get.

<p>Reimplemented from <a href="qpaintdevice.html#metric">QPaintDevice</a>.
<h3 class=fn><a href="qpixmap.html">QPixmap</a>&nbsp;&amp; <a name="operator-eq"></a>QPixmap::operator= ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap )
</h3>
Assigns the pixmap <em>pixmap</em> to this pixmap and returns a reference to
this pixmap.

<h3 class=fn><a href="qpixmap.html">QPixmap</a>&nbsp;&amp; <a name="operator-eq-2"></a>QPixmap::operator= ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;image )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Converts the image <em>image</em> to a pixmap that is assigned to this pixmap.
Returns a reference to the pixmap.
<p>See also <a href="#convertFromImage">convertFromImage</a>().

<h3 class=fn><a href="qpixmap.html#Optimization-enum">Optimization</a> <a name="optimization"></a>QPixmap::optimization () const
</h3>

<p> Returns the optimization setting for this pixmap.
<p> The default optimization setting is <a href="#Optimization-enum">QPixmap::NormalOptim</a>. You may
change this settings in two ways:
<ul>
<li> Call <a href="#setDefaultOptimization">setDefaultOptimization</a>() to set the default optimization
for all new pixmaps.
<li> Call <a href="#setOptimization">setOptimization</a>() to set a the optimization for individual
pixmaps.
</ul>
<p> <p>See also <a href="#setOptimization">setOptimization</a>(), <a href="#setDefaultOptimization">setDefaultOptimization</a>() and <a href="#defaultOptimization">defaultOptimization</a>().

<h3 class=fn><a href="qrect.html">QRect</a> <a name="rect"></a>QPixmap::rect () const
</h3>

Returns the enclosing rectangle (0,0,width(),height()) of the pixmap.
<p>See also <a href="#width">width</a>(), <a href="#height">height</a>() and <a href="#size">size</a>().

<p>Example: <a href="xform-example.html#x102">xform/xform.cpp</a>.
<h3 class=fn>void <a name="resize"></a>QPixmap::resize ( int&nbsp;w, int&nbsp;h )
</h3>
Resizes the pixmap to <em>w</em> width and <em>h</em> height.  If either <em>w</em>
or <em>h</em> is 0, the pixmap becomes a null pixmap.
<p> If both <em>w</em> and <em>h</em> are greater than 0, a valid pixmap is created.
New pixels will be uninitialized (random) if the pixmap is expanded.

<p>Examples: <a href="desktop-example.html#x1739">desktop/desktop.cpp</a> and <a href="grapher-nsplugin-example.html#x2618">grapher/grapher.cpp</a>.
<h3 class=fn>void <a name="resize-2"></a>QPixmap::resize ( const&nbsp;<a href="qsize.html">QSize</a>&nbsp;&amp;&nbsp;size )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Resizes the pixmap to size <em>size</em>.

<h3 class=fn>bool <a name="save"></a>QPixmap::save ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format, int&nbsp;quality = -1 ) const
</h3>
Saves the pixmap to the file <em>fileName</em> using the image file format
<em>format</em> and a quality factor <em>quality</em>.  <em>quality</em> must be in the
range [0,100] or -1.  Specify 0 to obtain small compressed files, 100
for large uncompressed files, and -1 to use the default settings.
Returns TRUE if successful, or FALSE if the pixmap could not be saved.
<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>.

<p>Example: <a href="qmag-example.html#x706">qmag/qmag.cpp</a>.
<h3 class=fn>bool <a name="selfMask"></a>QPixmap::selfMask () const
</h3>

Returns TRUE if the pixmap's mask is identical to the pixmap itself;
otherwise returns FALSE.
<p>See also <a href="#mask">mask</a>().

<h3 class=fn>int <a name="serialNumber"></a>QPixmap::serialNumber () const
</h3>

<p> Returns a number that uniquely identifies the contents of this QPixmap object.
This means that multiple QPixmaps objects can have the same serial number
as long as they refer to the same contents.
<p> An example of where this is useful is for caching QPixmaps.
<p> <p>See also <a href="qpixmapcache.html">QPixmapCache</a>.

<h3 class=fn>void <a name="setDefaultOptimization"></a>QPixmap::setDefaultOptimization ( <a href="qpixmap.html#Optimization-enum">Optimization</a>&nbsp;optimization )<tt> [static]</tt>
</h3>
Sets the default pixmap optimization.
<p> All <em>new</em> pixmaps that are created will use this default optimization.
You may also set optimization for individual pixmaps using the
<a href="#setOptimization">setOptimization</a>() function.
<p> The initial default <em>optimization</em> setting is <tt>QPixmap::Normal</tt>.
<p> <p>See also <a href="#defaultOptimization">defaultOptimization</a>(), <a href="#setOptimization">setOptimization</a>() and <a href="#optimization">optimization</a>().

<h3 class=fn>void <a name="setMask"></a>QPixmap::setMask ( const&nbsp;<a href="qbitmap.html">QBitmap</a>&nbsp;&amp;&nbsp;newmask )
</h3>
Sets a mask bitmap.
<p> The <em>newmask</em> bitmap defines the clip mask for this pixmap. Every pixel in
<em>newmask</em> corresponds to a pixel in this pixmap. Pixel value 1 means opaque
and pixel value 0 means transparent. The mask must have the same size as
this pixmap.
<p> Setting a <a href="#isNull">null</a> mask resets the mask.
<p> <p>See also <a href="#mask">mask</a>(), <a href="#createHeuristicMask">createHeuristicMask</a>() and <a href="qbitmap.html">QBitmap</a>.

<h3 class=fn>void <a name="setOptimization"></a>QPixmap::setOptimization ( <a href="qpixmap.html#Optimization-enum">Optimization</a>&nbsp;optimization )
</h3>
Sets pixmap drawing optimization for this pixmap.
<p> The <em>optimization</em> setting affects pixmap operations, in particular
drawing of transparent pixmaps (<a href="qpaintdevice.html#bitBlt">bitBlt</a>() a pixmap with a mask set) and
pixmap transformations (the <a href="#xForm">xForm</a>() function).
<p> Pixmap optimization involves keeping intermediate results in a cache
buffer and use the data in the cache to speed up bitBlt() and xForm().
The cost is more memory consumption, up to twice as much as an
unoptimized pixmap.
<p> Use the <a href="#setDefaultOptimization">setDefaultOptimization</a>() to change the default optimization
for all new pixmaps.
<p> <p>See also <a href="#optimization">optimization</a>(), <a href="#setDefaultOptimization">setDefaultOptimization</a>() and <a href="#defaultOptimization">defaultOptimization</a>().

<p>Example: <a href="desktop-example.html#x1740">desktop/desktop.cpp</a>.
<h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QPixmap::size () const
</h3>

Returns the size of the pixmap.
<p>See also <a href="#width">width</a>(), <a href="#height">height</a>() and <a href="#rect">rect</a>().

<p>Examples: <a href="movies-example.html#x1099">movies/main.cpp</a> and <a href="qtimage-nsplugin-example.html#x2445">qtimage/qtimage.cpp</a>.
<h3 class=fn><a href="qwmatrix.html">QWMatrix</a> <a name="trueMatrix"></a>QPixmap::trueMatrix ( const&nbsp;<a href="qwmatrix.html">QWMatrix</a>&nbsp;&amp;&nbsp;matrix, int&nbsp;w, int&nbsp;h )<tt> [static]</tt>
</h3>
Returns the actual matrix used for transforming a pixmap with <em>w</em>
width and <em>h</em> height and matrix <em>matrix</em>.
<p> When transforming a pixmap with <a href="#xForm">xForm</a>(), the transformation matrix
is internally adjusted to compensate for unwanted translation,
i.e. xForm() returns the smallest pixmap containing all transformed
points of the original pixmap.
<p> This function returns the modified matrix, which maps points
correctly from the original pixmap into the new pixmap.
<p> <p>See also <a href="#xForm">xForm</a>() and <a href="qwmatrix.html">QWMatrix</a>.

<h3 class=fn>int <a name="width"></a>QPixmap::width () const
</h3>

Returns the width of the pixmap.
<p>See also <a href="#height">height</a>(), <a href="#size">size</a>() and <a href="#rect">rect</a>().

<p>Examples: <a href="desktop-example.html#x1741">desktop/desktop.cpp</a>, <a href="movies-example.html#x1100">movies/main.cpp</a>, <a href="qtimage-nsplugin-example.html#x2446">qtimage/qtimage.cpp</a>, <a href="scribble-example.html#x537">scribble/scribble.cpp</a>, <a href="scrollview-example.html#x494">scrollview/scrollview.cpp</a> and <a href="xform-example.html#x103">xform/xform.cpp</a>.
<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="xForm"></a>QPixmap::xForm ( const&nbsp;<a href="qwmatrix.html">QWMatrix</a>&nbsp;&amp;&nbsp;matrix ) const
</h3>
Returns a copy of the pixmap that is transformed using <em>matrix</em>. The
original pixmap is not changed.
<p> The transformation <em>matrix</em> is internally adjusted to compensate
for unwanted translation, i.e. <a href="#xForm">xForm</a>() returns the smallest image
that contains all the transformed points of the original image.
<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>().

<p>Examples: <a href="desktop-example.html#x1742">desktop/desktop.cpp</a>, <a href="fileiconview-example.html#x1575">fileiconview/qfileiconview.cpp</a>, <a href="movies-example.html#x1101">movies/main.cpp</a>, <a href="qmag-example.html#x707">qmag/qmag.cpp</a>, <a href="qtimage-nsplugin-example.html#x2447">qtimage/qtimage.cpp</a> and <a href="xform-example.html#x104">xform/xform.cpp</a>.
<hr><h2>Related Functions</h2>
<h3 class=fn><a href="qdatastream.html">QDataStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;s, const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap )
</h3>

Writes the pixmap <em>pixmap</em> to the stream <em>s</em> as a PNG image.
<p> <p>See also <a href="#save">QPixmap::save</a>() and <a href="datastreamformat.html">Format of the QDataStream operators</a>.

<h3 class=fn><a href="qdatastream.html">QDataStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;s, <a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap )
</h3>

Reads a pixmap from the stream <em>s</em> into the pixmap <em>pixmap</em>.
<p>See also <a href="#load">QPixmap::load</a>() and <a href="datastreamformat.html">Format of the QDataStream operators</a>.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>