Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6142

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qpixmap.cpp -->
  <title>Qt 4.8: QPixmap Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QPixmap</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#reading-and-writing-image-files">Reading and Writing Image Files</a></li>
<li class="level2"><a href="#pixmap-information">Pixmap Information</a></li>
<li class="level2"><a href="#pixmap-conversion">Pixmap Conversion</a></li>
<li class="level2"><a href="#pixmap-transformations">Pixmap Transformations</a></li>
</ul>
</div>
<h1 class="title">QPixmap Class Reference</h1>
<!-- $$$QPixmap-brief -->
<p>The QPixmap class is an off-screen image representation that can be used as a paint device. <a href="#details">More...</a></p>
<!-- @@@QPixmap -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QPixmap&gt;</span></pre><p><b>Inherits: </b><a href="qpaintdevice.html">QPaintDevice</a>.</p>
<p><b>Inherited by: </b><a href="q3canvaspixmap.html" class="compat">Q3CanvasPixmap</a> and <a href="qbitmap.html">QBitmap</a>.</p>
<ul>
<li><a href="qpixmap-members.html">List of all members, including inherited members</a></li>
<li><a href="qpixmap-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#HBitmapFormat-enum">HBitmapFormat</a></b> { NoAlpha, PremultipliedAlpha, Alpha }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#ShareMode-enum">ShareMode</a></b> { ImplicitlyShared, ExplicitlyShared }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#QPixmap">QPixmap</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#QPixmap-3">QPixmap</a></b> ( int <i>width</i>, int <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#QPixmap-4">QPixmap</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#QPixmap-5">QPixmap</a></b> ( const char * const[] <i>xpm</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#QPixmap-6">QPixmap</a></b> ( const QPixmap &amp; <i>pixmap</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#QPixmap-11">QPixmap</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#dtor.QPixmap">~QPixmap</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#cacheKey">cacheKey</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#convertFromImage">convertFromImage</a></b> ( const QImage &amp; <i>image</i>, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#copy">copy</a></b> ( const QRect &amp; <i>rectangle</i> = QRect() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#copy-2">copy</a></b> ( int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBitmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#createHeuristicMask">createHeuristicMask</a></b> ( bool <i>clipTight</i> = true ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBitmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#createMaskFromColor">createMaskFromColor</a></b> ( const QColor &amp; <i>maskColor</i>, Qt::MaskMode <i>mode</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBitmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#createMaskFromColor-2">createMaskFromColor</a></b> ( const QColor &amp; <i>maskColor</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#depth">depth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#detach">detach</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fill">fill</a></b> ( const QColor &amp; <i>color</i> = Qt::white )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fill-2">fill</a></b> ( const QWidget * <i>widget</i>, const QPoint &amp; <i>offset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fill-3">fill</a></b> ( const QWidget * <i>widget</i>, int <i>x</i>, int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::HANDLE </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#handle">handle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#hasAlpha">hasAlpha</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#hasAlphaChannel">hasAlphaChannel</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#height">height</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#isQBitmap">isQBitmap</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#load">load</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#loadFromData">loadFromData</a></b> ( const uchar * <i>data</i>, uint <i>len</i>, const char * <i>format</i> = 0, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#loadFromData-3">loadFromData</a></b> ( const QByteArray &amp; <i>data</i>, const char * <i>format</i> = 0, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBitmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#mask">mask</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#rect">rect</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#save">save</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0, int <i>quality</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#save-2">save</a></b> ( QIODevice * <i>device</i>, const char * <i>format</i> = 0, int <i>quality</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#scaled">scaled</a></b> ( const QSize &amp; <i>size</i>, Qt::AspectRatioMode <i>aspectRatioMode</i> = Qt::IgnoreAspectRatio, Qt::TransformationMode <i>transformMode</i> = Qt::FastTransformation ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#scaled-2">scaled</a></b> ( int <i>width</i>, int <i>height</i>, Qt::AspectRatioMode <i>aspectRatioMode</i> = Qt::IgnoreAspectRatio, Qt::TransformationMode <i>transformMode</i> = Qt::FastTransformation ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#scaledToHeight">scaledToHeight</a></b> ( int <i>height</i>, Qt::TransformationMode <i>mode</i> = Qt::FastTransformation ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#scaledToWidth">scaledToWidth</a></b> ( int <i>width</i>, Qt::TransformationMode <i>mode</i> = Qt::FastTransformation ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#scroll">scroll</a></b> ( int <i>dx</i>, int <i>dy</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, QRegion * <i>exposed</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#scroll-2">scroll</a></b> ( int <i>dx</i>, int <i>dy</i>, const QRect &amp; <i>rect</i>, QRegion * <i>exposed</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#setMask">setMask</a></b> ( const QBitmap &amp; <i>mask</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#swap">swap</a></b> ( QPixmap &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QImage </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#toImage">toImage</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> CGImageRef </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#toMacCGImageRef">toMacCGImageRef</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> CFbsBitmap * </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#toSymbianCFbsBitmap">toSymbianCFbsBitmap</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> RSgImage * </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#toSymbianRSgImage">toSymbianRSgImage</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> HBITMAP </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#toWinHBITMAP">toWinHBITMAP</a></b> ( HBitmapFormat <i>format</i> = NoAlpha ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> HICON </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#toWinHICON">toWinHICON</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#transformed">transformed</a></b> ( const QTransform &amp; <i>transform</i>, Qt::TransformationMode <i>mode</i> = Qt::FastTransformation ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#transformed-2">transformed</a></b> ( const QMatrix &amp; <i>matrix</i>, Qt::TransformationMode <i>mode</i> = Qt::FastTransformation ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#width">width</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QX11Info &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#x11Info">x11Info</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::HANDLE </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#x11PictureHandle">x11PictureHandle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#operator-QVariant">operator QVariant</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#operator-not">operator!</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#operator-eq">operator=</a></b> ( const QPixmap &amp; <i>pixmap</i> )</td></tr>
</table>
<ul>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#defaultDepth">defaultDepth</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromImage">fromImage</a></b> ( const QImage &amp; <i>image</i>, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromImageReader">fromImageReader</a></b> ( QImageReader * <i>imageReader</i>, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromMacCGImageRef">fromMacCGImageRef</a></b> ( CGImageRef <i>image</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromSymbianCFbsBitmap">fromSymbianCFbsBitmap</a></b> ( CFbsBitmap * <i>bitmap</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromSymbianRSgImage">fromSymbianRSgImage</a></b> ( RSgImage * <i>sgImage</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromWinHBITMAP">fromWinHBITMAP</a></b> ( HBITMAP <i>bitmap</i>, HBitmapFormat <i>format</i> = NoAlpha )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromWinHICON">fromWinHICON</a></b> ( HICON <i>icon</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#fromX11Pixmap">fromX11Pixmap</a></b> ( Qt::HANDLE <i>pixmap</i>, ShareMode <i>mode</i> = ImplicitlyShared )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#grabWidget">grabWidget</a></b> ( QWidget * <i>widget</i>, const QRect &amp; <i>rectangle</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#grabWidget-2">grabWidget</a></b> ( QWidget * <i>widget</i>, int <i>x</i> = 0, int <i>y</i> = 0, int <i>width</i> = -1, int <i>height</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#grabWindow">grabWindow</a></b> ( WId <i>window</i>, int <i>x</i> = 0, int <i>y</i> = 0, int <i>width</i> = -1, int <i>height</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTransform </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#trueMatrix">trueMatrix</a></b> ( const QTransform &amp; <i>matrix</i>, int <i>width</i>, int <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMatrix </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#trueMatrix-2">trueMatrix</a></b> ( const QMatrix &amp; <i>m</i>, int <i>w</i>, int <i>h</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#operator-lt-lt-207">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QPixmap &amp; <i>pixmap</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpixmap.html#operator-gt-gt-113">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QPixmap &amp; <i>pixmap</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$QPixmap-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QPixmap class is an off-screen image representation that can be used as a paint device.</p>
<p>Qt provides four classes for handling image data: <a href="qimage.html">QImage</a>, QPixmap, <a href="qbitmap.html">QBitmap</a> and <a href="qpicture.html">QPicture</a>. <a href="qimage.html">QImage</a> is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen. <a href="qbitmap.html">QBitmap</a> is only a convenience class that inherits QPixmap, ensuring a depth of 1. The <a href="qpixmap.html#isQBitmap">isQBitmap</a>() function returns true if a QPixmap object is really a bitmap, otherwise returns false. Finally, the <a href="qpicture.html">QPicture</a> class is a paint device that records and replays <a href="qpainter.html">QPainter</a> commands.</p>
<p>A QPixmap can easily be displayed on the screen using <a href="qlabel.html">QLabel</a> or one of <a href="qabstractbutton.html">QAbstractButton</a>'s subclasses (such as <a href="qpushbutton.html">QPushButton</a> and <a href="qtoolbutton.html">QToolButton</a>). <a href="qlabel.html">QLabel</a> has a pixmap property, whereas <a href="qabstractbutton.html">QAbstractButton</a> has an icon property.</p>
<p>In addition to the ordinary constructors, a QPixmap can be constructed using the static <a href="qpixmap.html#grabWidget">grabWidget</a>() and <a href="qpixmap.html#grabWindow">grabWindow</a>() functions which creates a QPixmap and paints the given widget, or window, into it.</p>
<p>QPixmap objects can be passed around by value since the QPixmap class uses implicit data sharing. For more information, see the <a href="implicit-sharing.html#implicit-data-sharing">Implicit Data Sharing</a> documentation. QPixmap objects can also be streamed.</p>
<p>Note that the pixel data in a pixmap is internal and is managed by the underlying window system. Because QPixmap is a <a href="qpaintdevice.html">QPaintDevice</a> subclass, <a href="qpainter.html">QPainter</a> can be used to draw directly onto pixmaps. Pixels can only be accessed through <a href="qpainter.html">QPainter</a> functions or by converting the QPixmap to a <a href="qimage.html">QImage</a>. However, the <a href="qpixmap.html#fill">fill</a>() function is available for initializing the entire pixmap with a given color.</p>
<p>There are functions to convert between <a href="qimage.html">QImage</a> and QPixmap. Typically, the <a href="qimage.html">QImage</a> class is used to load an image file, optionally manipulating the image data, before the <a href="qimage.html">QImage</a> object is converted into a QPixmap to be shown on screen. Alternatively, if no manipulation is desired, the image file can be loaded directly into a QPixmap. On Windows, the QPixmap class also supports conversion between <tt>HBITMAP</tt> and QPixmap. On Symbian, the QPixmap class also supports conversion between CFbsBitmap and QPixmap.</p>
<p>QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap. In addition, there are several functions that enables transformation of the pixmap.</p>
<a name="reading-and-writing-image-files"></a>
<h3>Reading and Writing Image Files</h3>
<p>QPixmap provides several ways of reading an image file: The file can be loaded when constructing the QPixmap object, or by using the <a href="qpixmap.html#load">load</a>() or <a href="qpixmap.html#loadFromData">loadFromData</a>() functions later on. When loading an image, the file name can either refer to an actual file on disk or to one of the application's embedded resources. See <a href="resources.html">The Qt Resource System</a> overview for details on how to embed images and other resource files in the application's executable.</p>
<p>Simply call the <a href="qpixmap.html#save">save</a>() function to save a QPixmap object.</p>
<p>The complete list of supported file formats are available through the <a href="qimagereader.html#supportedImageFormats">QImageReader::supportedImageFormats</a>() and <a href="qimagewriter.html#supportedImageFormats">QImageWriter::supportedImageFormats</a>() functions. New file formats can be added as plugins. By default, Qt supports the following formats:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Format</th><th >Description</th><th >Qt's support</th></tr></thead>
<tr valign="top" class="odd"><td >BMP</td><td >Windows Bitmap</td><td >Read/write</td></tr>
<tr valign="top" class="even"><td >GIF</td><td >Graphic Interchange Format (optional)</td><td >Read</td></tr>
<tr valign="top" class="odd"><td >JPG</td><td >Joint Photographic Experts Group</td><td >Read/write</td></tr>
<tr valign="top" class="even"><td >JPEG</td><td >Joint Photographic Experts Group</td><td >Read/write</td></tr>
<tr valign="top" class="odd"><td >PNG</td><td >Portable Network Graphics</td><td >Read/write</td></tr>
<tr valign="top" class="even"><td >PBM</td><td >Portable Bitmap</td><td >Read</td></tr>
<tr valign="top" class="odd"><td >PGM</td><td >Portable Graymap</td><td >Read</td></tr>
<tr valign="top" class="even"><td >PPM</td><td >Portable Pixmap</td><td >Read/write</td></tr>
<tr valign="top" class="odd"><td >XBM</td><td >X11 Bitmap</td><td >Read/write</td></tr>
<tr valign="top" class="even"><td >XPM</td><td >X11 Pixmap</td><td >Read/write</td></tr>
</table>
<a name="pixmap-information"></a>
<h3>Pixmap Information</h3>
<p>QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap:</p>
<table class="generic">
<thead><tr class="qt-style"><th ></th><th >Available Functions</th></tr></thead>
<tr valign="top" class="odd"><td >Geometry</td><td >The <a href="qpixmap.html#size">size</a>(), <a href="qpixmap.html#width">width</a>() and <a href="qpixmap.html#height">height</a>() functions provide information about the pixmap's size. The <a href="qpixmap.html#rect">rect</a>() function returns the image's enclosing rectangle.</td></tr>
<tr valign="top" class="even"><td >Alpha component</td><td >The <a href="qpixmap.html#hasAlphaChannel">hasAlphaChannel</a>() returns true if the pixmap has a format that respects the alpha channel, otherwise returns false. The <a href="qpixmap.html#hasAlpha">hasAlpha</a>(), <a href="qpixmap.html#setMask">setMask</a>() and <a href="qpixmap.html#mask">mask</a>() functions are legacy and should not be used. They are potentially very slow.<p>The <a href="qpixmap.html#createHeuristicMask">createHeuristicMask</a>() function creates and returns a 1-bpp heuristic mask (i.e&#x2e; a <a href="qbitmap.html">QBitmap</a>) 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. The <a href="qpixmap.html#createMaskFromColor">createMaskFromColor</a>() function creates and returns a mask (i.e&#x2e; a <a href="qbitmap.html">QBitmap</a>) for the pixmap based on a given color.</p>
</td></tr>
<tr valign="top" class="odd"><td >Low-level information</td><td >The <a href="qpixmap.html#depth">depth</a>() function returns the depth of the pixmap. The <a href="qpixmap.html#defaultDepth">defaultDepth</a>() function returns the default depth, i.e&#x2e; the depth used by the application on the given screen.<p>The <a href="qpixmap.html#cacheKey">cacheKey</a>() function returns a number that uniquely identifies the contents of the QPixmap object.</p>
<p>The <a href="qpixmap.html#x11Info">x11Info</a>() function returns information about the configuration of the X display used by the screen to which the pixmap currently belongs. The <a href="qpixmap.html#x11PictureHandle">x11PictureHandle</a>() function returns the X11 Picture handle of the pixmap for XRender support. Note that the two latter functions are only available on x11.</p>
</td></tr>
</table>
<a name="pixmap-conversion"></a>
<h3>Pixmap Conversion</h3>
<p>A QPixmap object can be converted into a <a href="qimage.html">QImage</a> using the <a href="qpixmap.html#toImage">toImage</a>() function. Likewise, a <a href="qimage.html">QImage</a> can be converted into a QPixmap using the <a href="qpixmap.html#fromImage">fromImage</a>(). If this is too expensive an operation, you can use <a href="qbitmap.html#fromImage">QBitmap::fromImage</a>() instead.</p>
<p>In addition, on Windows, the QPixmap class supports conversion to and from HBITMAP: the <a href="qpixmap.html#toWinHBITMAP">toWinHBITMAP</a>() function creates a HBITMAP equivalent to the QPixmap, based on the given <a href="qpixmap.html#HBitmapFormat-enum">HBitmapFormat</a>, and returns the HBITMAP handle. The <a href="qpixmap.html#fromWinHBITMAP">fromWinHBITMAP</a>() function returns a QPixmap that is equivalent to the given bitmap which has the specified format. The QPixmap class also supports conversion to and from HICON: the <a href="qpixmap.html#toWinHICON">toWinHICON</a>() function creates a HICON equivalent to the QPixmap, and returns the HICON handle. The <a href="qpixmap.html#fromWinHICON">fromWinHICON</a>() function returns a QPixmap that is equivalent to the given icon.</p>
<p>In addition, on Symbian, the QPixmap class supports conversion to and from CFbsBitmap: the <a href="qpixmap.html#toSymbianCFbsBitmap">toSymbianCFbsBitmap</a>() function creates CFbsBitmap equivalent to the QPixmap, based on given mode and returns a CFbsBitmap object. The <a href="qpixmap.html#fromSymbianCFbsBitmap">fromSymbianCFbsBitmap</a>() function returns a QPixmap that is equivalent to the given bitmap and given mode.</p>
<a name="pixmap-transformations"></a>
<h3>Pixmap Transformations</h3>
<p>QPixmap supports a number of functions for creating a new pixmap that is a transformed version of the original:</p>
<p>The <a href="qpixmap.html#scaled">scaled</a>(), <a href="qpixmap.html#scaledToWidth">scaledToWidth</a>() and <a href="qpixmap.html#scaledToHeight">scaledToHeight</a>() functions return scaled copies of the pixmap, while the <a href="qpixmap.html#copy">copy</a>() function creates a QPixmap that is a plain copy of the original one.</p>
<p>The <a href="qpixmap.html#transformed">transformed</a>() function returns a copy of the pixmap that is transformed with the given transformation matrix and transformation mode: Internally, the transformation matrix is adjusted to compensate for unwanted translation, i.e&#x2e; <a href="qpixmap.html#transformed">transformed</a>() returns the smallest pixmap containing all transformed points of the original pixmap. The static <a href="qpixmap.html#trueMatrix">trueMatrix</a>() function returns the actual matrix used for transforming the pixmap.</p>
<p><b>Note:</b> When using the native X11 graphics system, the pixmap becomes invalid when the <a href="qapplication.html">QApplication</a> instance is destroyed.</p>
</div>
<p><b>See also </b><a href="qbitmap.html">QBitmap</a>, <a href="qimage.html">QImage</a>, <a href="qimagereader.html">QImageReader</a>, and <a href="qimagewriter.html">QImageWriter</a>.</p>
<!-- @@@QPixmap -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$HBitmapFormat$$$NoAlpha$$$PremultipliedAlpha$$$Alpha -->
<h3 class="fn"><a name="HBitmapFormat-enum"></a>enum QPixmap::<span class="name">HBitmapFormat</span></h3>
<p><b>Win32 only:</b> This enum defines how the conversion between <tt>HBITMAP</tt> and <a href="qpixmap.html">QPixmap</a> is performed.</p>
<p><b>Warning:</b> This enum is only available on Windows.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPixmap::NoAlpha</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The alpha channel is ignored and always treated as being set to fully opaque. This is preferred if the <tt>HBITMAP</tt> is used with standard GDI calls, such as <tt>BitBlt()</tt>.</td></tr>
<tr><td class="topAlign"><tt>QPixmap::PremultipliedAlpha</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The <tt>HBITMAP</tt> is treated as having an alpha channel and premultiplied colors. This is preferred if the <tt>HBITMAP</tt> is accessed through the <tt>AlphaBlend()</tt> GDI function.</td></tr>
<tr><td class="topAlign"><tt>QPixmap::Alpha</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The <tt>HBITMAP</tt> is treated as having a plain alpha channel. This is the preferred format if the <tt>HBITMAP</tt> is going to be used as an application icon or systray icon.</td></tr>
</table>
<p><b>See also </b><a href="qpixmap.html#fromWinHBITMAP">fromWinHBITMAP</a>() and <a href="qpixmap.html#toWinHBITMAP">toWinHBITMAP</a>().</p>
<!-- @@@HBitmapFormat -->
<!-- $$$ShareMode$$$ImplicitlyShared$$$ExplicitlyShared -->
<h3 class="fn"><a name="ShareMode-enum"></a>enum QPixmap::<span class="name">ShareMode</span></h3>
<p>This enum type defines the share modes that are available when creating a <a href="qpixmap.html">QPixmap</a> object from a raw X11 Pixmap handle.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPixmap::ImplicitlyShared</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">This mode will cause the <a href="qpixmap.html">QPixmap</a> object to create a copy of the internal data before it is modified, thus keeping the original X11 pixmap intact.</td></tr>
<tr><td class="topAlign"><tt>QPixmap::ExplicitlyShared</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">In this mode, the pixmap data will <i>not</i> be copied before it is modified, which in effect will change the original X11 pixmap.</td></tr>
</table>
<p><b>Warning:</b> This enum is only used for X11 specific functions; using it is non-portable.</p>
<p>This enum was introduced or modified in Qt 4.5.</p>
<p><b>See also </b><a href="qpixmap.html#fromX11Pixmap">QPixmap::fromX11Pixmap</a>().</p>
<!-- @@@ShareMode -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPixmap[overload1]$$$QPixmap -->
<h3 class="fn"><a name="QPixmap"></a>QPixmap::<span class="name">QPixmap</span> ()</h3>
<p>Constructs a null pixmap.</p>
<p><b>See also </b><a href="qpixmap.html#isNull">isNull</a>().</p>
<!-- @@@QPixmap -->
<!-- $$$QPixmap$$$QPixmapintint -->
<h3 class="fn"><a name="QPixmap-3"></a>QPixmap::<span class="name">QPixmap</span> ( <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i> )</h3>
<p>Constructs a pixmap with the given <i>width</i> and <i>height</i>. If either <i>width</i> or <i>height</i> is zero, a null pixmap is constructed.</p>
<p><b>Warning:</b> This will create a <a href="qpixmap.html">QPixmap</a> with uninitialized data. Call <a href="qpixmap.html#fill">fill</a>() to fill the pixmap with an appropriate color before drawing onto it with <a href="qpainter.html">QPainter</a>.</p>
<p><b>See also </b><a href="qpixmap.html#isNull">isNull</a>().</p>
<!-- @@@QPixmap -->
<!-- $$$QPixmap$$$QPixmapconstQString&constchar*Qt::ImageConversionFlags -->
<h3 class="fn"><a name="QPixmap-4"></a>QPixmap::<span class="name">QPixmap</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i>, const <span class="type">char</span> * <i>format</i> = 0, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )</h3>
<p>Constructs a pixmap from the file with the given <i>fileName</i>. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.</p>
<p>The loader attempts to read the pixmap using the specified <i>format</i>. If the <i>format</i> is not specified (which is the default), the loader probes the file for a header to guess the file format.</p>
<p>The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the <a href="resources.html">Resource System</a> overview for details on how to embed images and other resource files in the application's executable.</p>
<p>If the image needs to be modified to fit in a lower-resolution result (e.g&#x2e; converting from 32-bit to 8-bit), use the <i>flags</i> to control the conversion.</p>
<p>The <i>fileName</i>, <i>format</i> and <i>flags</i> parameters are passed on to <a href="qpixmap.html#load">load</a>(). This means that the data in <i>fileName</i> is not compiled into the binary. If <i>fileName</i> contains a relative path (e.g&#x2e; the filename only) the relevant file must be found relative to the runtime working directory.</p>
<p><b>See also </b><a href="qpixmap.html#reading-and-writing-image-files">Reading and Writing Image Files</a>.</p>
<!-- @@@QPixmap -->
<!-- $$$QPixmap$$$QPixmapconstchar*const[] -->
<h3 class="fn"><a name="QPixmap-5"></a>QPixmap::<span class="name">QPixmap</span> ( const <span class="type">char</span> * const[] <i>xpm</i> )</h3>
<p>Constructs a pixmap from the given <i>xpm</i> data, which must be a valid XPM image.</p>
<p>Errors are silently ignored.</p>
<p>Note that it's possible to squeeze the XPM variable a little bit by using an unusual declaration:</p>
<pre class="cpp"> <span class="keyword">static</span> <span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span> <span class="keyword">const</span> start_xpm<span class="operator">[</span><span class="operator">]</span><span class="operator">=</span>{
     <span class="string">&quot;16 15 8 1&quot;</span><span class="operator">,</span>
     <span class="string">&quot;a c #cec6bd&quot;</span><span class="operator">,</span>
 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></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>
<!-- @@@QPixmap -->
<!-- $$$QPixmap$$$QPixmapconstQPixmap& -->
<h3 class="fn"><a name="QPixmap-6"></a>QPixmap::<span class="name">QPixmap</span> ( const <span class="type">QPixmap</span> &amp; <i>pixmap</i> )</h3>
<p>Constructs a pixmap that is a copy of the given <i>pixmap</i>.</p>
<p><b>See also </b><a href="qpixmap.html#copy">copy</a>().</p>
<!-- @@@QPixmap -->
<!-- $$$QPixmap$$$QPixmapconstQSize& -->
<h3 class="fn"><a name="QPixmap-11"></a>QPixmap::<span class="name">QPixmap</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i> )</h3>
<p>This is an overloaded function.</p>
<p>Constructs a pixmap of the given <i>size</i>.</p>
<p><b>Warning:</b> This will create a <a href="qpixmap.html">QPixmap</a> with uninitialized data. Call <a href="qpixmap.html#fill">fill</a>() to fill the pixmap with an appropriate color before drawing onto it with <a href="qpainter.html">QPainter</a>.</p>
<!-- @@@QPixmap -->
<!-- $$$~QPixmap[overload1]$$$~QPixmap -->
<h3 class="fn"><a name="dtor.QPixmap"></a>QPixmap::<span class="name">~QPixmap</span> ()</h3>
<p>Destroys the pixmap.</p>
<!-- @@@~QPixmap -->
<!-- $$$cacheKey[overload1]$$$cacheKey -->
<h3 class="fn"><a name="cacheKey"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QPixmap::<span class="name">cacheKey</span> () const</h3>
<p>Returns a number that identifies this <a href="qpixmap.html">QPixmap</a>. Distinct <a href="qpixmap.html">QPixmap</a> objects can only have the same cache key if they refer to the same contents.</p>
<p>The cacheKey() will change when the pixmap is altered.</p>
<!-- @@@cacheKey -->
<!-- $$$convertFromImage[overload1]$$$convertFromImageconstQImage&Qt::ImageConversionFlags -->
<h3 class="fn"><a name="convertFromImage"></a><span class="type">bool</span> QPixmap::<span class="name">convertFromImage</span> ( const <span class="type"><a href="qimage.html">QImage</a></span> &amp; <i>image</i>, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )</h3>
<p>Replaces this pixmap's data with the given <i>image</i> using the specified <i>flags</i> to control the conversion. The <i>flags</i> argument is a bitwise-OR of the <a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a>. Passing 0 for <i>flags</i> sets all the default options. Returns true if the result is that this pixmap is not null.</p>
<p>Note: this function was part of Qt 3 support in Qt 4.6 and earlier. It has been promoted to official API status in 4.7 to support updating the pixmap's image without creating a new <a href="qpixmap.html">QPixmap</a> as <a href="qpixmap.html#fromImage">fromImage</a>() would.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qpixmap.html#fromImage">fromImage</a>().</p>
<!-- @@@convertFromImage -->
<!-- $$$copy[overload1]$$$copyconstQRect& -->
<h3 class="fn"><a name="copy"></a><span class="type">QPixmap</span> QPixmap::<span class="name">copy</span> ( const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <i>rectangle</i> = QRect() ) const</h3>
<p>Returns a deep copy of the subset of the pixmap that is specified by the given <i>rectangle</i>. For more information on deep copies, see the <a href="implicit-sharing.html#implicit-data-sharing">Implicit Data Sharing</a> documentation.</p>
<p>If the given <i>rectangle</i> is empty, the whole image is copied.</p>
<p><b>See also </b><a href="qpixmap.html#operator-eq">operator=</a>(), <a href="qpixmap.html#QPixmap">QPixmap</a>(), and <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@copy -->
<!-- $$$copy$$$copyintintintint -->
<h3 class="fn"><a name="copy-2"></a><span class="type">QPixmap</span> QPixmap::<span class="name">copy</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns a deep copy of the subset of the pixmap that is specified by the rectangle <a href="qrect.html">QRect</a>( <i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>).</p>
<!-- @@@copy -->
<!-- $$$createHeuristicMask[overload1]$$$createHeuristicMaskbool -->
<h3 class="fn"><a name="createHeuristicMask"></a><span class="type"><a href="qbitmap.html">QBitmap</a></span> QPixmap::<span class="name">createHeuristicMask</span> ( <span class="type">bool</span> <i>clipTight</i> = true ) const</h3>
<p>Creates and returns a heuristic mask for this pixmap.</p>
<p>The function works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges. If <i>clipTight</i> is true (the default) the mask is just large enough to cover the pixels; otherwise, the mask is larger than the data pixels.</p>
<p>The mask may not be perfect but it should be reasonable, so you can do things such as the following:</p>
<pre class="cpp"> <span class="type"><a href="qpixmap.html">QPixmap</a></span> myPixmap;
 myPixmap<span class="operator">-</span><span class="operator">&gt;</span>setMask(myPixmap<span class="operator">-</span><span class="operator">&gt;</span>createHeuristicMask());</pre>
<p>This function is slow because it involves converting to/from a <a href="qimage.html">QImage</a>, and non-trivial computations.</p>
<p><b>See also </b><a href="qimage.html#createHeuristicMask">QImage::createHeuristicMask</a>() and <a href="qpixmap.html#createMaskFromColor">createMaskFromColor</a>().</p>
<!-- @@@createHeuristicMask -->
<!-- $$$createMaskFromColor[overload1]$$$createMaskFromColorconstQColor&Qt::MaskMode -->
<h3 class="fn"><a name="createMaskFromColor"></a><span class="type"><a href="qbitmap.html">QBitmap</a></span> QPixmap::<span class="name">createMaskFromColor</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>maskColor</i>, <span class="type"><a href="qt.html#MaskMode-enum">Qt::MaskMode</a></span> <i>mode</i> ) const</h3>
<p>Creates and returns a mask for this pixmap based on the given <i>maskColor</i>. If the <i>mode</i> is <a href="qt.html#MaskMode-enum">Qt::MaskInColor</a>, all pixels matching the maskColor will be transparent. If <i>mode</i> is <a href="qt.html#MaskMode-enum">Qt::MaskOutColor</a>, all pixels matching the maskColor will be opaque.</p>
<p>This function is slow because it involves converting to/from a <a href="qimage.html">QImage</a>.</p>
<p><b>See also </b><a href="qpixmap.html#createHeuristicMask">createHeuristicMask</a>() and <a href="qimage.html#createMaskFromColor">QImage::createMaskFromColor</a>().</p>
<!-- @@@createMaskFromColor -->
<!-- $$$createMaskFromColor$$$createMaskFromColorconstQColor& -->
<h3 class="fn"><a name="createMaskFromColor-2"></a><span class="type"><a href="qbitmap.html">QBitmap</a></span> QPixmap::<span class="name">createMaskFromColor</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>maskColor</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Creates and returns a mask for this pixmap based on the given <i>maskColor</i>. Same as calling createMaskFromColor(maskColor, <a href="qt.html#MaskMode-enum">Qt::MaskInColor</a>)</p>
<p><b>See also </b><a href="qpixmap.html#createHeuristicMask">createHeuristicMask</a>() and <a href="qimage.html#createMaskFromColor">QImage::createMaskFromColor</a>().</p>
<!-- @@@createMaskFromColor -->
<!-- $$$defaultDepth[overload1]$$$defaultDepth -->
<h3 class="fn"><a name="defaultDepth"></a><span class="type">int</span> QPixmap::<span class="name">defaultDepth</span> ()<tt> [static]</tt></h3>
<p>Returns the default pixmap depth used by the application.</p>
<p>On Windows and Mac, the default depth is always 32. On X11 and embedded, the depth of the screen will be returned by this function.</p>
<p><b>See also </b><a href="qpixmap.html#depth">depth</a>(), <a href="qcolormap.html#depth">QColormap::depth</a>(), and <a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@defaultDepth -->
<!-- $$$depth[overload1]$$$depth -->
<h3 class="fn"><a name="depth"></a><span class="type">int</span> QPixmap::<span class="name">depth</span> () const</h3>
<p>Returns the depth of the pixmap.</p>
<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><b>See also </b><a href="qpixmap.html#defaultDepth">defaultDepth</a>() and <a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@depth -->
<!-- $$$detach[overload1]$$$detach -->
<h3 class="fn"><a name="detach"></a><span class="type">void</span> QPixmap::<span class="name">detach</span> ()</h3>
<p>Detaches the pixmap from shared pixmap data.</p>
<p>A pixmap is automatically detached by Qt whenever its contents are about to change. This is done in almost all <a href="qpixmap.html">QPixmap</a> member functions that modify the pixmap (<a href="qpixmap.html#fill">fill</a>(), <a href="qpixmap.html#fromImage">fromImage</a>(), <a href="qpixmap.html#load">load</a>(), etc.), and in <a href="qpainter.html#begin">QPainter::begin</a>() on a pixmap.</p>
<p>There are two exceptions in which detach() must be called explicitly, that is when calling the <a href="qpixmap.html#handle">handle</a>() or the <a href="qpixmap.html#x11PictureHandle">x11PictureHandle</a>() function (only available on X11). Otherwise, any modifications done using system calls, will be performed on the shared data.</p>
<p>The detach() function returns immediately if there is just a single reference or if the pixmap has not been initialized yet.</p>
<!-- @@@detach -->
<!-- $$$fill[overload1]$$$fillconstQColor& -->
<h3 class="fn"><a name="fill"></a><span class="type">void</span> QPixmap::<span class="name">fill</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>color</i> = Qt::white )</h3>
<p>Fills the pixmap with the given <i>color</i>.</p>
<p>The effect of this function is undefined when the pixmap is being painted on.</p>
<p><b>See also </b><a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@fill -->
<!-- $$$fill$$$fillconstQWidget*constQPoint& -->
<h3 class="fn"><a name="fill-2"></a><span class="type">void</span> QPixmap::<span class="name">fill</span> ( const <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>offset</i> )</h3>
<p>Fills the pixmap with the <i>widget</i>'s background color or pixmap according to the given offset.</p>
<p>The <a href="qpoint.html">QPoint</a> <i>offset</i> defines a point in widget coordinates to which the pixmap's top-left pixel will be mapped to. This is only significant if the widget has a background pixmap; otherwise the pixmap will simply be filled with the background color of the widget.</p>
<!-- @@@fill -->
<!-- $$$fill$$$fillconstQWidget*intint -->
<h3 class="fn"><a name="fill-3"></a><span class="type">void</span> QPixmap::<span class="name">fill</span> ( const <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i> )</h3>
<p>This is an overloaded function.</p>
<p>Fills the pixmap with the <i>widget</i>'s background color or pixmap. The given point, (<i>x</i>, <i>y</i>), defines an offset in widget coordinates to which the pixmap's top-left pixel will be mapped to.</p>
<!-- @@@fill -->
<!-- $$$fromImage[overload1]$$$fromImageconstQImage&Qt::ImageConversionFlags -->
<h3 class="fn"><a name="fromImage"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromImage</span> ( const <span class="type"><a href="qimage.html">QImage</a></span> &amp; <i>image</i>, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )<tt> [static]</tt></h3>
<p>Converts the given <i>image</i> to a pixmap using the specified <i>flags</i> to control the conversion. The <i>flags</i> argument is a bitwise-OR of the <a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a>. Passing 0 for <i>flags</i> sets all the default options.</p>
<p>In case of monochrome and 8-bit images, the image is first converted to a 32-bit pixmap and then filled with the colors in the color table. If this is too expensive an operation, you can use <a href="qbitmap.html#fromImage">QBitmap::fromImage</a>() instead.</p>
<p><b>See also </b><a href="qpixmap.html#fromImageReader">fromImageReader</a>(), <a href="qpixmap.html#toImage">toImage</a>(), and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromImage -->
<!-- $$$fromImageReader[overload1]$$$fromImageReaderQImageReader*Qt::ImageConversionFlags -->
<h3 class="fn"><a name="fromImageReader"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromImageReader</span> ( <span class="type"><a href="qimagereader.html">QImageReader</a></span> * <i>imageReader</i>, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )<tt> [static]</tt></h3>
<p>Create a <a href="qpixmap.html">QPixmap</a> from an image read directly from an <i>imageReader</i>. The <i>flags</i> argument is a bitwise-OR of the <a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a>. Passing 0 for <i>flags</i> sets all the default options.</p>
<p>On some systems, reading an image directly to <a href="qpixmap.html">QPixmap</a> can use less memory than reading a <a href="qimage.html">QImage</a> to convert it to <a href="qpixmap.html">QPixmap</a>.</p>
<p><b>See also </b><a href="qpixmap.html#fromImage">fromImage</a>(), <a href="qpixmap.html#toImage">toImage</a>(), and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromImageReader -->
<!-- $$$fromMacCGImageRef[overload1]$$$fromMacCGImageRefCGImageRef -->
<h3 class="fn"><a name="fromMacCGImageRef"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromMacCGImageRef</span> ( <span class="type">CGImageRef</span> <i>image</i> )<tt> [static]</tt></h3>
<p>Returns a <a href="qpixmap.html">QPixmap</a> that is equivalent to the given <i>image</i>.</p>
<p><b>Warning:</b> This function is only available on Mac OS X.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qpixmap.html#toMacCGImageRef">toMacCGImageRef</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromMacCGImageRef -->
<!-- $$$fromSymbianCFbsBitmap[overload1]$$$fromSymbianCFbsBitmapCFbsBitmap* -->
<h3 class="fn"><a name="fromSymbianCFbsBitmap"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromSymbianCFbsBitmap</span> ( <span class="type">CFbsBitmap</span> * <i>bitmap</i> )<tt> [static]</tt></h3>
<p>Creates a <a href="qpixmap.html">QPixmap</a> from a <tt>CFbsBitmap</tt> <i>bitmap</i>. Internally this function will try to duplicate the bitmap handle instead of copying the data, however in scenarios where this is not possible the data will be copied. To be sure that <a href="qpixmap.html">QPixmap</a> does not modify your original instance, you should make a copy of your <tt>CFbsBitmap</tt> before calling this function. If the CFbsBitmap is not valid this function will return a null <a href="qpixmap.html">QPixmap</a>. For performance reasons it is recommended to use a <i>bitmap</i> with a display mode of EColor16MAP or EColor16MU whenever possible.</p>
<p><b>Warning:</b> This function is only available on Symbian OS.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpixmap.html#toSymbianCFbsBitmap">toSymbianCFbsBitmap</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromSymbianCFbsBitmap -->
<!-- $$$fromSymbianRSgImage[overload1]$$$fromSymbianRSgImageRSgImage* -->
<h3 class="fn"><a name="fromSymbianRSgImage"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromSymbianRSgImage</span> ( <span class="type">RSgImage</span> * <i>sgImage</i> )<tt> [static]</tt></h3>
<p>Returns a <a href="qpixmap.html">QPixmap</a> that wraps given <i>sgImage</i> graphics resource. The data should be valid even when original RSgImage handle has been closed.</p>
<p><b>Warning:</b> This function is only available on Symbian OS.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpixmap.html#toSymbianRSgImage">toSymbianRSgImage</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromSymbianRSgImage -->
<!-- $$$fromWinHBITMAP[overload1]$$$fromWinHBITMAPHBITMAPHBitmapFormat -->
<h3 class="fn"><a name="fromWinHBITMAP"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromWinHBITMAP</span> ( <span class="type">HBITMAP</span> <i>bitmap</i>, <span class="type"><a href="qpixmap.html#HBitmapFormat-enum">HBitmapFormat</a></span> <i>format</i> = NoAlpha )<tt> [static]</tt></h3>
<p><b>Win32 only:</b> Returns a <a href="qpixmap.html">QPixmap</a> that is equivalent to the given <i>bitmap</i>. The conversion is based on the specified <i>format</i>.</p>
<p><b>Warning:</b> This function is only available on Windows.</p>
<p><b>See also </b><a href="qpixmap.html#toWinHBITMAP">toWinHBITMAP</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromWinHBITMAP -->
<!-- $$$fromWinHICON[overload1]$$$fromWinHICONHICON -->
<h3 class="fn"><a name="fromWinHICON"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromWinHICON</span> ( <span class="type">HICON</span> <i>icon</i> )<tt> [static]</tt></h3>
<p><b>Win32 only:</b> Returns a <a href="qpixmap.html">QPixmap</a> that is equivalent to the given <i>icon</i>.</p>
<p><b>Warning:</b> This function is only available on Windows.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpixmap.html#toWinHICON">toWinHICON</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@fromWinHICON -->
<!-- $$$fromX11Pixmap[overload1]$$$fromX11PixmapQt::HANDLEShareMode -->
<h3 class="fn"><a name="fromX11Pixmap"></a><span class="type">QPixmap</span> QPixmap::<span class="name">fromX11Pixmap</span> ( <span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> <i>pixmap</i>, <span class="type"><a href="qpixmap.html#ShareMode-enum">ShareMode</a></span> <i>mode</i> = ImplicitlyShared )<tt> [static]</tt></h3>
<p>Creates a <a href="qpixmap.html">QPixmap</a> from the native X11 Pixmap handle <i>pixmap</i>, using <i>mode</i> as the share mode. The default share mode is <a href="qpixmap.html#ShareMode-enum">QPixmap::ImplicitlyShared</a>, which means that a copy of the pixmap is made if someone tries to modify it by e.g&#x2e; drawing onto it.</p>
<p><a href="qpixmap.html">QPixmap</a> does <i>not</i> take ownership of the <i>pixmap</i> handle, and have to be deleted by the user.</p>
<p><b>Warning:</b> This function is X11 specific; using it is non-portable.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpixmap.html#ShareMode-enum">QPixmap::ShareMode</a>.</p>
<!-- @@@fromX11Pixmap -->
<!-- $$$grabWidget[overload1]$$$grabWidgetQWidget*constQRect& -->
<h3 class="fn"><a name="grabWidget"></a><span class="type">QPixmap</span> QPixmap::<span class="name">grabWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <i>rectangle</i> )<tt> [static]</tt></h3>
<p>Creates a pixmap and paints the given <i>widget</i>, restricted by the given <i>rectangle</i>, in it. If the <i>widget</i> has any children, then they are also painted in the appropriate positions.</p>
<p>If no rectangle is specified (the default) the entire widget is painted.</p>
<p>If <i>widget</i> is 0, the specified rectangle doesn't overlap the widget's rectangle, or an error occurs, the function will return a null <a href="qpixmap.html">QPixmap</a>. If the rectangle is a superset of the given <i>widget</i>, the areas outside the <i>widget</i> are covered with the widget's background.</p>
<p>This function actually asks <i>widget</i> to paint itself (and its children to paint themselves) by calling paintEvent() with painter redirection turned on. But <a href="qpixmap.html">QPixmap</a> also provides the <a href="qpixmap.html#grabWindow">grabWindow</a>() function which is a bit faster by grabbing pixels directly off the screen. In addition, if there are overlaying windows, <a href="qpixmap.html#grabWindow">grabWindow</a>(), unlike grabWidget(), will see them.</p>
<p><b>Warning:</b> Do not grab a widget from its <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>(). However, it is safe to grab a widget from another widget's <a href="qwidget.html#paintEvent">paintEvent()</a>.</p>
<p><b>See also </b><a href="qpixmap.html#grabWindow">grabWindow</a>().</p>
<!-- @@@grabWidget -->
<!-- $$$grabWidget$$$grabWidgetQWidget*intintintint -->
<h3 class="fn"><a name="grabWidget-2"></a><span class="type">QPixmap</span> QPixmap::<span class="name">grabWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type">int</span> <i>x</i> = 0, <span class="type">int</span> <i>y</i> = 0, <span class="type">int</span> <i>width</i> = -1, <span class="type">int</span> <i>height</i> = -1 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Creates a pixmap and paints the given <i>widget</i>, restricted by <a href="qrect.html">QRect</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>), in it.</p>
<p><b>Warning:</b> Do not grab a widget from its <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>(). However, it is safe to grab a widget from another widget's <a href="qwidget.html#paintEvent">paintEvent()</a>.</p>
<!-- @@@grabWidget -->
<!-- $$$grabWindow[overload1]$$$grabWindowWIdintintintint -->
<h3 class="fn"><a name="grabWindow"></a><span class="type">QPixmap</span> QPixmap::<span class="name">grabWindow</span> ( <span class="type"><a href="qwidget.html#WId-typedef">WId</a></span> <i>window</i>, <span class="type">int</span> <i>x</i> = 0, <span class="type">int</span> <i>y</i> = 0, <span class="type">int</span> <i>width</i> = -1, <span class="type">int</span> <i>height</i> = -1 )<tt> [static]</tt></h3>
<p>Creates and returns a pixmap constructed by grabbing the contents of the given <i>window</i> restricted by <a href="qrect.html">QRect</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>).</p>
<p>The arguments (<i>x</i>, <i>y</i>) specify the offset in the window, whereas (<i>width</i>, <i>height</i>) specify the area to be copied. If <i>width</i> is negative, the function copies everything to the right border of the window. If <i>height</i> is negative, the function copies everything to the bottom of the window.</p>
<p>The window system identifier (<tt>WId</tt>) can be retrieved using the <a href="qwidget.html#winId">QWidget::winId</a>() function. The rationale for using 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>
<p>The grabWindow() function grabs pixels from the screen, not from the window, i.e&#x2e; if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.</p>
<p>Note on X11 that if the given <i>window</i> doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will <i>not</i> get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.</p>
<p>On Windows Vista and above grabbing a layered window, which is created by setting the <a href="qt.html#WidgetAttribute-enum">Qt::WA_TranslucentBackground</a> attribute, will not work. Instead grabbing the desktop widget should work.</p>
<p><b>Warning:</b> In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.</p>
<p><b>See also </b><a href="qpixmap.html#grabWidget">grabWidget</a>() and <a href="desktop-screenshot.html">Screenshot Example</a>.</p>
<!-- @@@grabWindow -->
<!-- $$$handle[overload1]$$$handle -->
<h3 class="fn"><a name="handle"></a><span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> QPixmap::<span class="name">handle</span> () const</h3>
<p>Returns the pixmap's handle to the device context.</p>
<p>Note that, since <a href="qpixmap.html">QPixmap</a> make use of <a href="implicit-sharing.html#implicit-data-sharing">implicit data sharing</a>, the <a href="qpixmap.html#detach">detach</a>() function must be called explicitly to ensure that only <i>this</i> pixmap's data is modified if the pixmap data is shared.</p>
<p><b>Warning:</b> This function is X11 specific; using it is non-portable.</p>
<p><b>Warning:</b> Since 4.8, pixmaps do not have an X11 handle unless created with <a href="qpixmap.html#fromX11Pixmap">fromX11Pixmap()</a>, or if the native graphics system is explicitly enabled.</p>
<p><b>See also </b><a href="qpixmap.html#detach">detach</a>() and <a href="qapplication.html#setGraphicsSystem">QApplication::setGraphicsSystem</a>().</p>
<!-- @@@handle -->
<!-- $$$hasAlpha[overload1]$$$hasAlpha -->
<h3 class="fn"><a name="hasAlpha"></a><span class="type">bool</span> QPixmap::<span class="name">hasAlpha</span> () const</h3>
<p>Returns true if this pixmap has an alpha channel, <i>or</i> has a mask, otherwise returns false.</p>
<p><b>See also </b><a href="qpixmap.html#hasAlphaChannel">hasAlphaChannel</a>() and <a href="qpixmap.html#mask">mask</a>().</p>
<!-- @@@hasAlpha -->
<!-- $$$hasAlphaChannel[overload1]$$$hasAlphaChannel -->
<h3 class="fn"><a name="hasAlphaChannel"></a><span class="type">bool</span> QPixmap::<span class="name">hasAlphaChannel</span> () const</h3>
<p>Returns true if the pixmap has a format that respects the alpha channel, otherwise returns false.</p>
<p><b>See also </b><a href="qpixmap.html#hasAlpha">hasAlpha</a>().</p>
<!-- @@@hasAlphaChannel -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn"><a name="height"></a><span class="type">int</span> QPixmap::<span class="name">height</span> () const</h3>
<p>Returns the height of the pixmap.</p>
<p><b>See also </b><a href="qpixmap.html#size">size</a>() and <a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@height -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QPixmap::<span class="name">isNull</span> () const</h3>
<p>Returns true if this is a null pixmap; otherwise returns false.</p>
<p>A null pixmap has zero width, zero height and no contents. You cannot draw in a null pixmap.</p>
<!-- @@@isNull -->
<!-- $$$isQBitmap[overload1]$$$isQBitmap -->
<h3 class="fn"><a name="isQBitmap"></a><span class="type">bool</span> QPixmap::<span class="name">isQBitmap</span> () const</h3>
<p>Returns true if this is a <a href="qbitmap.html">QBitmap</a>; otherwise returns false.</p>
<!-- @@@isQBitmap -->
<!-- $$$load[overload1]$$$loadconstQString&constchar*Qt::ImageConversionFlags -->
<h3 class="fn"><a name="load"></a><span class="type">bool</span> QPixmap::<span class="name">load</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i>, const <span class="type">char</span> * <i>format</i> = 0, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )</h3>
<p>Loads a pixmap from the file with the given <i>fileName</i>. Returns true if the pixmap was successfully loaded; otherwise returns false.</p>
<p>The loader attempts to read the pixmap using the specified <i>format</i>. If the <i>format</i> is not specified (which is the default), the loader probes the file for a header to guess the file format.</p>
<p>The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the <a href="resources.html">Resource System</a> overview for details on how to embed pixmaps and other resource files in the application's executable.</p>
<p>If the data needs to be modified to fit in a lower-resolution result (e.g&#x2e; converting from 32-bit to 8-bit), use the <i>flags</i> to control the conversion.</p>
<p>Note that QPixmaps are automatically added to the <a href="qpixmapcache.html">QPixmapCache</a> when loaded from a file; the key used is internal and can not be acquired.</p>
<p><b>See also </b><a href="qpixmap.html#loadFromData">loadFromData</a>() and <a href="qpixmap.html#reading-and-writing-image-files">Reading and Writing Image Files</a>.</p>
<!-- @@@load -->
<!-- $$$loadFromData[overload1]$$$loadFromDataconstuchar*uintconstchar*Qt::ImageConversionFlags -->
<h3 class="fn"><a name="loadFromData"></a><span class="type">bool</span> QPixmap::<span class="name">loadFromData</span> ( const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>data</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>len</i>, const <span class="type">char</span> * <i>format</i> = 0, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )</h3>
<p>Loads a pixmap from the <i>len</i> first bytes of the given binary <i>data</i>. Returns true if the pixmap was loaded successfully; otherwise returns false.</p>
<p>The loader attempts to read the pixmap using the specified <i>format</i>. If the <i>format</i> is not specified (which is the default), the loader probes the file for a header to guess the file format.</p>
<p>If the data needs to be modified to fit in a lower-resolution result (e.g&#x2e; converting from 32-bit to 8-bit), use the <i>flags</i> to control the conversion.</p>
<p><b>See also </b><a href="qpixmap.html#load">load</a>() and <a href="qpixmap.html#reading-and-writing-image-files">Reading and Writing Image Files</a>.</p>
<!-- @@@loadFromData -->
<!-- $$$loadFromData$$$loadFromDataconstQByteArray&constchar*Qt::ImageConversionFlags -->
<h3 class="fn"><a name="loadFromData-3"></a><span class="type">bool</span> QPixmap::<span class="name">loadFromData</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>data</i>, const <span class="type">char</span> * <i>format</i> = 0, <span class="type"><a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor )</h3>
<p>This is an overloaded function.</p>
<p>Loads a pixmap from the binary <i>data</i> using the specified <i>format</i> and conversion <i>flags</i>.</p>
<!-- @@@loadFromData -->
<!-- $$$mask[overload1]$$$mask -->
<h3 class="fn"><a name="mask"></a><span class="type"><a href="qbitmap.html">QBitmap</a></span> QPixmap::<span class="name">mask</span> () const</h3>
<p>Extracts a bitmap mask from the pixmap's alpha channel.</p>
<p><b>Warning:</b> This is potentially an expensive operation. The mask of the pixmap is extracted dynamically from the pixeldata.</p>
<p><b>See also </b><a href="qpixmap.html#setMask">setMask</a>() and <a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@mask -->
<!-- $$$rect[overload1]$$$rect -->
<h3 class="fn"><a name="rect"></a><span class="type"><a href="qrect.html">QRect</a></span> QPixmap::<span class="name">rect</span> () const</h3>
<p>Returns the pixmap's enclosing rectangle.</p>
<p><b>See also </b><a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@rect -->
<!-- $$$save[overload1]$$$saveconstQString&constchar*int -->
<h3 class="fn"><a name="save"></a><span class="type">bool</span> QPixmap::<span class="name">save</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i>, const <span class="type">char</span> * <i>format</i> = 0, <span class="type">int</span> <i>quality</i> = -1 ) const</h3>
<p>Saves the pixmap to the file with the given <i>fileName</i> using the specified image file <i>format</i> and <i>quality</i> factor. Returns true if successful; otherwise returns false.</p>
<p>The <i>quality</i> factor 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.</p>
<p>If <i>format</i> is 0, an image format will be chosen from <i>fileName</i>'s suffix.</p>
<p><b>See also </b><a href="qpixmap.html#reading-and-writing-image-files">Reading and Writing Image Files</a>.</p>
<!-- @@@save -->
<!-- $$$save$$$saveQIODevice*constchar*int -->
<h3 class="fn"><a name="save-2"></a><span class="type">bool</span> QPixmap::<span class="name">save</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i>, const <span class="type">char</span> * <i>format</i> = 0, <span class="type">int</span> <i>quality</i> = -1 ) const</h3>
<p>This is an overloaded function.</p>
<p>This function writes a <a href="qpixmap.html">QPixmap</a> to the given <i>device</i> using the specified image file <i>format</i> and <i>quality</i> factor. This can be used, for example, to save a pixmap directly into a <a href="qbytearray.html">QByteArray</a>:</p>
<pre class="cpp">         <span class="type"><a href="qpixmap.html">QPixmap</a></span> pixmap;
         <span class="type"><a href="qbytearray.html">QByteArray</a></span> bytes;
         <span class="type"><a href="qbuffer.html">QBuffer</a></span> buffer(<span class="operator">&amp;</span>bytes);
         buffer<span class="operator">.</span>open(<span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">::</span>WriteOnly);
         pixmap<span class="operator">.</span>save(<span class="operator">&amp;</span>buffer<span class="operator">,</span> <span class="string">&quot;PNG&quot;</span>); <span class="comment">// writes pixmap into bytes in PNG format</span></pre>
<!-- @@@save -->
<!-- $$$scaled[overload1]$$$scaledconstQSize&Qt::AspectRatioModeQt::TransformationMode -->
<h3 class="fn"><a name="scaled"></a><span class="type">QPixmap</span> QPixmap::<span class="name">scaled</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i>, <span class="type"><a href="qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></span> <i>aspectRatioMode</i> = Qt::IgnoreAspectRatio, <span class="type"><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a></span> <i>transformMode</i> = Qt::FastTransformation ) const</h3>
<p>Scales the pixmap to the given <i>size</i>, using the aspect ratio and transformation modes specified by <i>aspectRatioMode</i> and <i>transformMode</i>.</p>
<p class="centerAlign"><img src="images/qimage-scaling.png" alt="" /></p><ul>
<li>If <i>aspectRatioMode</i> is <a href="qt.html#AspectRatioMode-enum">Qt::IgnoreAspectRatio</a>, the pixmap is scaled to <i>size</i>.</li>
<li>If <i>aspectRatioMode</i> is <a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatio</a>, the pixmap is scaled to a rectangle as large as possible inside <i>size</i>, preserving the aspect ratio.</li>
<li>If <i>aspectRatioMode</i> is <a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatioByExpanding</a>, the pixmap is scaled to a rectangle as small as possible outside <i>size</i>, preserving the aspect ratio.</li>
</ul>
<p>If the given <i>size</i> is empty, this function returns a null pixmap.</p>
<p>In some cases it can be more beneficial to draw the pixmap to a painter with a scale set rather than scaling the pixmap. This is the case when the painter is for instance based on OpenGL or when the scale factor changes rapidly.</p>
<p><b>See also </b><a href="qpixmap.html#isNull">isNull</a>() and <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@scaled -->
<!-- $$$scaled$$$scaledintintQt::AspectRatioModeQt::TransformationMode -->
<h3 class="fn"><a name="scaled-2"></a><span class="type">QPixmap</span> QPixmap::<span class="name">scaled</span> ( <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, <span class="type"><a href="qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></span> <i>aspectRatioMode</i> = Qt::IgnoreAspectRatio, <span class="type"><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a></span> <i>transformMode</i> = Qt::FastTransformation ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns a copy of the pixmap scaled to a rectangle with the given <i>width</i> and <i>height</i> according to the given <i>aspectRatioMode</i> and <i>transformMode</i>.</p>
<p>If either the <i>width</i> or the <i>height</i> is zero or negative, this function returns a null pixmap.</p>
<!-- @@@scaled -->
<!-- $$$scaledToHeight[overload1]$$$scaledToHeightintQt::TransformationMode -->
<h3 class="fn"><a name="scaledToHeight"></a><span class="type">QPixmap</span> QPixmap::<span class="name">scaledToHeight</span> ( <span class="type">int</span> <i>height</i>, <span class="type"><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a></span> <i>mode</i> = Qt::FastTransformation ) const</h3>
<p>Returns a scaled copy of the image. The returned image is scaled to the given <i>height</i> using the specified transformation <i>mode</i>. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.</p>
<p>If <i>height</i> is 0 or negative, a null pixmap is returned.</p>
<p><b>See also </b><a href="qpixmap.html#isNull">isNull</a>() and <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@scaledToHeight -->
<!-- $$$scaledToWidth[overload1]$$$scaledToWidthintQt::TransformationMode -->
<h3 class="fn"><a name="scaledToWidth"></a><span class="type">QPixmap</span> QPixmap::<span class="name">scaledToWidth</span> ( <span class="type">int</span> <i>width</i>, <span class="type"><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a></span> <i>mode</i> = Qt::FastTransformation ) const</h3>
<p>Returns a scaled copy of the image. The returned image is scaled to the given <i>width</i> using the specified transformation <i>mode</i>. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.</p>
<p>If <i>width</i> is 0 or negative, a null pixmap is returned.</p>
<p><b>See also </b><a href="qpixmap.html#isNull">isNull</a>() and <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@scaledToWidth -->
<!-- $$$scroll[overload1]$$$scrollintintintintintintQRegion* -->
<h3 class="fn"><a name="scroll"></a><span class="type">void</span> QPixmap::<span class="name">scroll</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, <span class="type"><a href="qregion.html">QRegion</a></span> * <i>exposed</i> = 0 )</h3>
<p>This convenience function is equivalent to calling QPixmap::scroll(<i>dx</i>, <i>dy</i>, <a href="qrect.html">QRect</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>), <i>exposed</i>).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qwidget.html#scroll">QWidget::scroll</a>() and <a href="qgraphicsitem.html#scroll">QGraphicsItem::scroll</a>().</p>
<!-- @@@scroll -->
<!-- $$$scroll$$$scrollintintconstQRect&QRegion* -->
<h3 class="fn"><a name="scroll-2"></a><span class="type">void</span> QPixmap::<span class="name">scroll</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i>, const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <i>rect</i>, <span class="type"><a href="qregion.html">QRegion</a></span> * <i>exposed</i> = 0 )</h3>
<p>Scrolls the area <i>rect</i> of this pixmap by (<i>dx</i>, <i>dy</i>). The exposed region is left unchanged. You can optionally pass a pointer to an empty <a href="qregion.html">QRegion</a> to get the region that is <i>exposed</i> by the scroll operation.</p>
<pre class="cpp"> <span class="type"><a href="qpixmap.html">QPixmap</a></span> pixmap(<span class="string">&quot;background.png&quot;</span>);
 <span class="type"><a href="qregion.html">QRegion</a></span> exposed;
 pixmap<span class="operator">.</span>scroll(<span class="number">10</span><span class="operator">,</span> <span class="number">10</span><span class="operator">,</span> pixmap<span class="operator">.</span>rect()<span class="operator">,</span> <span class="operator">&amp;</span>exposed);</pre>
<p>You cannot scroll while there is an active painter on the pixmap.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qwidget.html#scroll">QWidget::scroll</a>() and <a href="qgraphicsitem.html#scroll">QGraphicsItem::scroll</a>().</p>
<!-- @@@scroll -->
<!-- $$$setMask[overload1]$$$setMaskconstQBitmap& -->
<h3 class="fn"><a name="setMask"></a><span class="type">void</span> QPixmap::<span class="name">setMask</span> ( const <span class="type"><a href="qbitmap.html">QBitmap</a></span> &amp; <i>mask</i> )</h3>
<p>Sets a mask bitmap.</p>
<p>This function merges the <i>mask</i> with the pixmap's alpha channel. A pixel value of 1 on the mask means the pixmap's pixel is unchanged; a value of 0 means the pixel is transparent. The mask must have the same size as this pixmap.</p>
<p>Setting a null mask resets the mask, leaving the previously transparent pixels black. The effect of this function is undefined when the pixmap is being painted on.</p>
<p><b>Warning:</b> This is potentially an expensive operation.</p>
<p><b>See also </b><a href="qpixmap.html#mask">mask</a>(), <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>, and <a href="qbitmap.html">QBitmap</a>.</p>
<!-- @@@setMask -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type"><a href="qsize.html">QSize</a></span> QPixmap::<span class="name">size</span> () const</h3>
<p>Returns the size of the pixmap.</p>
<p><b>See also </b><a href="qpixmap.html#width">width</a>(), <a href="qpixmap.html#height">height</a>(), and <a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@size -->
<!-- $$$swap[overload1]$$$swapQPixmap& -->
<h3 class="fn"><a name="swap"></a><span class="type">void</span> QPixmap::<span class="name">swap</span> ( <span class="type">QPixmap</span> &amp; <i>other</i> )</h3>
<p>Swaps pixmap <i>other</i> with this pixmap. This operation is very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@swap -->
<!-- $$$toImage[overload1]$$$toImage -->
<h3 class="fn"><a name="toImage"></a><span class="type"><a href="qimage.html">QImage</a></span> QPixmap::<span class="name">toImage</span> () const</h3>
<p>Converts the pixmap to a <a href="qimage.html">QImage</a>. Returns a null image if the conversion fails.</p>
<p>If the pixmap has 1-bit depth, the returned image will also be 1 bit deep. Images with more bits will be returned in a format closely represents the underlying system. Usually this will be <a href="qimage.html#Format-enum">QImage::Format_ARGB32_Premultiplied</a> for pixmaps with an alpha and <a href="qimage.html#Format-enum">QImage::Format_RGB32</a> or <a href="qimage.html#Format-enum">QImage::Format_RGB16</a> for pixmaps without alpha.</p>
<p>Note that for the moment, alpha masks on monochrome images are ignored.</p>
<p><b>See also </b><a href="qpixmap.html#fromImage">fromImage</a>() and <a href="qimage.html#image-formats">Image Formats</a>.</p>
<!-- @@@toImage -->
<!-- $$$toMacCGImageRef[overload1]$$$toMacCGImageRef -->
<h3 class="fn"><a name="toMacCGImageRef"></a><span class="type">CGImageRef</span> QPixmap::<span class="name">toMacCGImageRef</span> () const</h3>
<p>Creates a <tt>CGImageRef</tt> equivalent to the <a href="qpixmap.html">QPixmap</a>. Returns the <tt>CGImageRef</tt> handle.</p>
<p>It is the caller's responsibility to release the <tt>CGImageRef</tt> data after use.</p>
<p><b>Warning:</b> This function is only available on Mac OS X.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qpixmap.html#fromMacCGImageRef">fromMacCGImageRef</a>().</p>
<!-- @@@toMacCGImageRef -->
<!-- $$$toSymbianCFbsBitmap[overload1]$$$toSymbianCFbsBitmap -->
<h3 class="fn"><a name="toSymbianCFbsBitmap"></a><span class="type">CFbsBitmap</span> * QPixmap::<span class="name">toSymbianCFbsBitmap</span> () const</h3>
<p>Creates a <tt>CFbsBitmap</tt> that is equivalent to the <a href="qpixmap.html">QPixmap</a>. Internally this function will try to duplicate the handle instead of copying the data, however in scenarios where this is not possible the data will be copied. If the creation fails or the pixmap is null, then this function returns 0.</p>
<p>It is the caller's responsibility to release the <tt>CFbsBitmap</tt> data after use either by deleting the bitmap or calling <tt>Reset()</tt>.</p>
<p><b>Warning:</b> On S60 3.1 and S60 3.2, semi-transparent pixmaps are always copied and not duplicated.</p>
<p><b>Warning:</b> This function is only available on Symbian OS.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpixmap.html#fromSymbianCFbsBitmap">fromSymbianCFbsBitmap</a>().</p>
<!-- @@@toSymbianCFbsBitmap -->
<!-- $$$toSymbianRSgImage[overload1]$$$toSymbianRSgImage -->
<h3 class="fn"><a name="toSymbianRSgImage"></a><span class="type">RSgImage</span> * QPixmap::<span class="name">toSymbianRSgImage</span> () const</h3>
<p>Returns a <tt>RSgImage</tt> that is equivalent to the <a href="qpixmap.html">QPixmap</a> by copying the data.</p>
<p>It is the caller's responsibility to close/delete the <tt>RSgImage</tt> after use.</p>
<p><b>Warning:</b> This function is only available on Symbian OS.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpixmap.html#fromSymbianRSgImage">fromSymbianRSgImage</a>().</p>
<!-- @@@toSymbianRSgImage -->
<!-- $$$toWinHBITMAP[overload1]$$$toWinHBITMAPHBitmapFormat -->
<h3 class="fn"><a name="toWinHBITMAP"></a><span class="type">HBITMAP</span> QPixmap::<span class="name">toWinHBITMAP</span> ( <span class="type"><a href="qpixmap.html#HBitmapFormat-enum">HBitmapFormat</a></span> <i>format</i> = NoAlpha ) const</h3>
<p><b>Win32 only:</b> Creates a <tt>HBITMAP</tt> equivalent to the <a href="qpixmap.html">QPixmap</a>, based on the given <i>format</i>. Returns the <tt>HBITMAP</tt> handle.</p>
<p>It is the caller's responsibility to free the <tt>HBITMAP</tt> data after use.</p>
<p><b>Warning:</b> This function is only available on Windows.</p>
<p><b>See also </b><a href="qpixmap.html#fromWinHBITMAP">fromWinHBITMAP</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@toWinHBITMAP -->
<!-- $$$toWinHICON[overload1]$$$toWinHICON -->
<h3 class="fn"><a name="toWinHICON"></a><span class="type">HICON</span> QPixmap::<span class="name">toWinHICON</span> () const</h3>
<p><b>Win32 only:</b> Creates a <tt>HICON</tt> equivalent to the <a href="qpixmap.html">QPixmap</a>. Returns the <tt>HICON</tt> handle.</p>
<p>It is the caller's responsibility to free the <tt>HICON</tt> data after use.</p>
<p><b>Warning:</b> This function is only available on Windows.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpixmap.html#fromWinHICON">fromWinHICON</a>() and <a href="qpixmap.html#pixmap-conversion">Pixmap Conversion</a>.</p>
<!-- @@@toWinHICON -->
<!-- $$$transformed[overload1]$$$transformedconstQTransform&Qt::TransformationMode -->
<h3 class="fn"><a name="transformed"></a><span class="type">QPixmap</span> QPixmap::<span class="name">transformed</span> ( const <span class="type"><a href="qtransform.html">QTransform</a></span> &amp; <i>transform</i>, <span class="type"><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a></span> <i>mode</i> = Qt::FastTransformation ) const</h3>
<p>Returns a copy of the pixmap that is transformed using the given transformation <i>transform</i> and transformation <i>mode</i>. The original pixmap is not changed.</p>
<p>The transformation <i>transform</i> is internally adjusted to compensate for unwanted translation; i.e&#x2e; the pixmap produced is the smallest pixmap that contains all the transformed points of the original pixmap. Use the <a href="qpixmap.html#trueMatrix">trueMatrix</a>() function to retrieve the actual matrix used for transforming the pixmap.</p>
<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="qpixmap.html">QPixmap</a>.</p>
<p><b>See also </b><a href="qpixmap.html#trueMatrix">trueMatrix</a>() and <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@transformed -->
<!-- $$$transformed$$$transformedconstQMatrix&Qt::TransformationMode -->
<h3 class="fn"><a name="transformed-2"></a><span class="type">QPixmap</span> QPixmap::<span class="name">transformed</span> ( const <span class="type"><a href="qmatrix.html">QMatrix</a></span> &amp; <i>matrix</i>, <span class="type"><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a></span> <i>mode</i> = Qt::FastTransformation ) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function loads the <i>matrix</i> into a <a href="qtransform.html">QTransform</a> and calls the overloaded function.</p>
<!-- @@@transformed -->
<!-- $$$trueMatrix[overload1]$$$trueMatrixconstQTransform&intint -->
<h3 class="fn"><a name="trueMatrix"></a><span class="type"><a href="qtransform.html">QTransform</a></span> QPixmap::<span class="name">trueMatrix</span> ( const <span class="type"><a href="qtransform.html">QTransform</a></span> &amp; <i>matrix</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i> )<tt> [static]</tt></h3>
<p>Returns the actual matrix used for transforming a pixmap with the given <i>width</i>, <i>height</i> and <i>matrix</i>.</p>
<p>When transforming a pixmap using the <a href="qpixmap.html#transformed">transformed</a>() function, the transformation matrix is internally adjusted to compensate for unwanted translation, i.e&#x2e; <a href="qpixmap.html#transformed">transformed</a>() returns the smallest pixmap containing all transformed points of the original pixmap. This function returns the modified matrix, which maps points correctly from the original pixmap into the new pixmap.</p>
<p><b>See also </b><a href="qpixmap.html#transformed">transformed</a>() and <a href="qpixmap.html#pixmap-transformations">Pixmap Transformations</a>.</p>
<!-- @@@trueMatrix -->
<!-- $$$trueMatrix$$$trueMatrixconstQMatrix&intint -->
<h3 class="fn"><a name="trueMatrix-2"></a><span class="type"><a href="qmatrix.html">QMatrix</a></span> QPixmap::<span class="name">trueMatrix</span> ( const <span class="type"><a href="qmatrix.html">QMatrix</a></span> &amp; <i>m</i>, <span class="type">int</span> <i>w</i>, <span class="type">int</span> <i>h</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>This convenience function loads the matrix <i>m</i> into a <a href="qtransform.html">QTransform</a> and calls the overloaded function with the <a href="qtransform.html">QTransform</a> and the width <i>w</i> and the height <i>h</i>.</p>
<!-- @@@trueMatrix -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn"><a name="width"></a><span class="type">int</span> QPixmap::<span class="name">width</span> () const</h3>
<p>Returns the width of the pixmap.</p>
<p><b>See also </b><a href="qpixmap.html#size">size</a>() and <a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@width -->
<!-- $$$x11Info[overload1]$$$x11Info -->
<h3 class="fn"><a name="x11Info"></a>const <span class="type"><a href="qx11info.html">QX11Info</a></span> &amp; QPixmap::<span class="name">x11Info</span> () const</h3>
<p><b>X11 only:</b> Returns information about the configuration of the X display used by the screen to which the pixmap currently belongs.</p>
<p><b>Warning:</b> This function is only available on X11.</p>
<p><b>See also </b><a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@x11Info -->
<!-- $$$x11PictureHandle[overload1]$$$x11PictureHandle -->
<h3 class="fn"><a name="x11PictureHandle"></a><span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> QPixmap::<span class="name">x11PictureHandle</span> () const</h3>
<p><b>X11 only:</b> Returns the X11 Picture handle of the pixmap for XRender support.</p>
<p>This function will return 0 if XRender support is not compiled into Qt, if the XRender extension is not supported on the X11 display, or if the handle could not be created. Use of this function is not portable.</p>
<p><b>Warning:</b> This function is only available on X11.</p>
<p><b>See also </b><a href="qpixmap.html#pixmap-information">Pixmap Information</a>.</p>
<!-- @@@x11PictureHandle -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn"><a name="operator-QVariant"></a>QPixmap::<span class="name">operator QVariant</span> () const</h3>
<p>Returns the pixmap as a <a href="qvariant.html">QVariant</a>.</p>
<!-- @@@operator QVariant -->
<!-- $$$operator![overload1]$$$operator! -->
<h3 class="fn"><a name="operator-not"></a><span class="type">bool</span> QPixmap::<span class="name">operator!</span> () const</h3>
<p>Returns true if this is a null pixmap; otherwise returns false.</p>
<p><b>See also </b><a href="qpixmap.html#isNull">isNull</a>().</p>
<!-- @@@operator! -->
<!-- $$$operator=[overload1]$$$operator=constQPixmap& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QPixmap</span> &amp; QPixmap::<span class="name">operator=</span> ( const <span class="type">QPixmap</span> &amp; <i>pixmap</i> )</h3>
<p>Assigns the given <i>pixmap</i> to this pixmap and returns a reference to this pixmap.</p>
<p><b>See also </b><a href="qpixmap.html#copy">copy</a>() and <a href="qpixmap.html#QPixmap">QPixmap</a>().</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDataStream&constQPixmap& -->
<h3 class="fn"><a name="operator-lt-lt-207"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, const <span class="type">QPixmap</span> &amp; <i>pixmap</i> )</h3>
<p>Writes the given <i>pixmap</i> to the given <i>stream</i> as a PNG image. Note that writing the stream to a file will not produce a valid image file.</p>
<p><b>See also </b><a href="qpixmap.html#save">QPixmap::save</a>() and <a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>$$$operator>>QDataStream&QPixmap& -->
<h3 class="fn"><a name="operator-gt-gt-113"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, <span class="type">QPixmap</span> &amp; <i>pixmap</i> )</h3>
<p>Reads an image from the given <i>stream</i> into the given <i>pixmap</i>.</p>
<p><b>See also </b><a href="qpixmap.html#load">QPixmap::load</a>() and <a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>