Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 3800

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/src/gui/image/qbitmap.cpp -->
<head>
  <title>Qt 4.2: QBitmap Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QBitmap Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QBitmap class provides monochrome (1-bit depth) pixmaps. <a href="#details">More...</a></p>
<pre> #include &lt;QBitmap&gt;</pre><p>Inherits <a href="qpixmap.html">QPixmap</a>.</p>
<ul>
<li><a href="qbitmap-members.html">List of all members, including inherited members</a></li>
<li><a href="qbitmap-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qbitmap.html#QBitmap">QBitmap</a></b> ()</li>
<li><div class="fn"/><b><a href="qbitmap.html#QBitmap-2">QBitmap</a></b> ( const QPixmap &amp; <i>pixmap</i> )</li>
<li><div class="fn"/><b><a href="qbitmap.html#QBitmap-3">QBitmap</a></b> ( int <i>width</i>, int <i>height</i> )</li>
<li><div class="fn"/><b><a href="qbitmap.html#QBitmap-4">QBitmap</a></b> ( const QSize &amp; <i>size</i> )</li>
<li><div class="fn"/><b><a href="qbitmap.html#QBitmap-5">QBitmap</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</li>
<li><div class="fn"/><b><a href="qbitmap.html#dtor.QBitmap">~QBitmap</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qbitmap.html#clear">clear</a></b> ()</li>
<li><div class="fn"/>QBitmap <b><a href="qbitmap.html#transformed">transformed</a></b> ( const QMatrix &amp; <i>matrix</i> ) const</li>
<li><div class="fn"/><b><a href="qbitmap.html#operator-QVariant">operator QVariant</a></b> () const</li>
<li><div class="fn"/>QBitmap &amp; <b><a href="qbitmap.html#operator-eq">operator=</a></b> ( const QPixmap &amp; <i>pixmap</i> )</li>
</ul>
<ul>
<li><div class="fn"/>41 public functions inherited from <a href="qpixmap.html#public-functions">QPixmap</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="static-public-members"></a>
<h3>Static Public Members</h3>
<ul>
<li><div class="fn"/>QBitmap <b><a href="qbitmap.html#fromData">fromData</a></b> ( const QSize &amp; <i>size</i>, const uchar * <i>bits</i>, QImage::Format <i>monoFormat</i> = QImage::Format_MonoLSB )</li>
<li><div class="fn"/>QBitmap <b><a href="qbitmap.html#fromImage">fromImage</a></b> ( const QImage &amp; <i>image</i>, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</li>
</ul>
<ul>
<li><div class="fn"/>8 static public members inherited from <a href="qpixmap.html#static-public-members">QPixmap</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QBitmap class provides monochrome (1-bit depth) pixmaps.</p>
<p>The QBitmap class is a monochrome off-screen paint device used mainly for creating custom <a href="qcursor.html">QCursor</a> and <a href="qbrush.html">QBrush</a> objects, constructing <a href="qregion.html">QRegion</a> objects, and for setting masks for pixmaps and widgets.</p>
<p>QBitmap is a <a href="qpixmap.html">QPixmap</a> subclass ensuring a depth of 1, except for null objects which have a depth of 0. If a pixmap with a depth greater than 1 is assigned to a bitmap, the bitmap will be dithered automatically.</p>
<p>Use the <a href="qcolor.html">QColor</a> objects <a href="qt.html#GlobalColor-enum">Qt::color0</a> and <a href="qt.html#GlobalColor-enum">Qt::color1</a> when drawing on a QBitmap object (or a <a href="qpixmap.html">QPixmap</a> object with depth 1).</p>
<p>Painting with <a href="qt.html#GlobalColor-enum">Qt::color0</a> sets the bitmap bits to 0, and painting with <a href="qt.html#GlobalColor-enum">Qt::color1</a> sets the bits to 1. For a bitmap, 0-bits indicate background (or transparent pixels) and 1-bits indicate foreground (or opaque pixels). Use the <a href="qbitmap.html#clear">clear</a>() function to set all the bits to <a href="qt.html#GlobalColor-enum">Qt::color0</a>. Note that using the <a href="qt.html#GlobalColor-enum">Qt::black</a> and <a href="qt.html#GlobalColor-enum">Qt::white</a> colors make no sense because the <a href="qcolor-qt3.html#pixel">QColor::pixel</a>() value is not necessarily 0 for black and 1 for white.</p>
<p>The QBitmap class provides the <a href="qbitmap.html#transformed">transformed</a>() function returning a transformed copy of the bitmap; use the <a href="qmatrix.html">QMatrix</a> argument to translate, scale, shear, and rotate the bitmap. In addition, QBitmap provides the static <a href="qbitmap.html#fromData">fromData</a>() function which returns a bitmap constructed from the given <tt>uchar</tt> data, and the static <a href="qbitmap.html#fromImage">fromImage</a>() function returning a converted copy of a <a href="qimage.html">QImage</a> object.</p>
<p>Just like the <a href="qpixmap.html">QPixmap</a> class, QBitmap is optimized by the use of implicit data sharing. For more information, see the {Implicit Data Sharing} documentation.</p>
<p>See also <a href="qpixmap.html">QPixmap</a>, <a href="qimage.html">QImage</a>, <a href="qimagereader.html">QImageReader</a>, and <a href="qimagewriter.html">QImageWriter</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QBitmap"></a>QBitmap::QBitmap ()</h3>
<p>Constructs a null bitmap.</p>
<p>See also <a href="qpixmap.html#isNull">QPixmap::isNull</a>().</p>
<h3 class="fn"><a name="QBitmap-2"></a>QBitmap::QBitmap ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i> )</h3>
<p>Constructs a bitmap that is a copy of the given <i>pixmap</i>.</p>
<p>If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.</p>
<p>See also <a href="qpixmap.html#depth">QPixmap::depth</a>(), <a href="qbitmap.html#fromImage">fromImage</a>(), and <a href="qbitmap.html#fromData">fromData</a>().</p>
<h3 class="fn"><a name="QBitmap-3"></a>QBitmap::QBitmap ( int <i>width</i>, int <i>height</i> )</h3>
<p>Constructs a bitmap with the given <i>width</i> and <i>height</i>. The pixels inside are uninitialized.</p>
<p>See also <a href="qbitmap.html#clear">clear</a>().</p>
<h3 class="fn"><a name="QBitmap-4"></a>QBitmap::QBitmap ( const <a href="qsize.html">QSize</a> &amp; <i>size</i> )</h3>
<p>Constructs a bitmap with the given <i>size</i>. The pixels in the bitmap are uninitialized.</p>
<p>See also <a href="qbitmap.html#clear">clear</a>().</p>
<h3 class="fn"><a name="QBitmap-5"></a>QBitmap::QBitmap ( const <a href="qstring.html">QString</a> &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</h3>
<p>Constructs a bitmap from the file specified by the given <i>fileName</i>. If the file does not exist, or has an unknown format, the bitmap becomes a null bitmap.</p>
<p>The <i>fileName</i> and <i>format</i> parameters are passed on to the <a href="qpixmap.html#load">QPixmap::load</a>() function. If the file format uses more than 1 bit per pixel, the resulting bitmap will be dithered automatically.</p>
<p>See also <a href="qpixmap.html#isNull">QPixmap::isNull</a>() and <a href="qimagereader.html#imageFormat">QImageReader::imageFormat</a>().</p>
<h3 class="fn"><a name="dtor.QBitmap"></a>QBitmap::~QBitmap ()</h3>
<p>Destroys the bitmap.</p>
<h3 class="fn"><a name="clear"></a>void QBitmap::clear ()</h3>
<p>Clears the bitmap, setting all its bits to <a href="qt.html#GlobalColor-enum">Qt::color0</a>.</p>
<h3 class="fn"><a name="fromData"></a>QBitmap QBitmap::fromData ( const <a href="qsize.html">QSize</a> &amp; <i>size</i>, const <a href="qtglobal.html#uchar-typedef">uchar</a> * <i>bits</i>, <a href="qimage.html#Format-enum">QImage::Format</a> <i>monoFormat</i> = QImage::Format_MonoLSB )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Constructs a bitmap with the given <i>size</i>, and sets the contents to the <i>bits</i> supplied.</p>
<p>The bitmap data has to be byte aligned and provided in in the bit order specified by <i>monoFormat</i>. The mono format must be either <a href="qimage.html#Format-enum">QImage::Format_Mono</a> or <a href="qimage.html#Format-enum">QImage::Format_MonoLSB</a>. Use <a href="qimage.html#Format-enum">QImage::Format_Mono</a> to specify data on the XBM format.</p>
<p>See also <a href="qbitmap.html#fromImage">fromImage</a>().</p>
<h3 class="fn"><a name="fromImage"></a>QBitmap QBitmap::fromImage ( const <a href="qimage.html">QImage</a> &amp; <i>image</i>, <a href="qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a> <i>flags</i> = Qt::AutoColor )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns a copy of the given <i>image</i> converted to a bitmap using the specified image conversion <i>flags</i>.</p>
<p>See also <a href="qbitmap.html#fromData">fromData</a>().</p>
<h3 class="fn"><a name="transformed"></a>QBitmap QBitmap::transformed ( const <a href="qmatrix.html">QMatrix</a> &amp; <i>matrix</i> ) const</h3>
<p>Returns a copy of this bitmap, transformed according to the given <i>matrix</i>.</p>
<p>See also <a href="qpixmap.html#transformed">QPixmap::transformed</a>().</p>
<h3 class="fn"><a name="operator-QVariant"></a>QBitmap::operator QVariant () const</h3>
<p>Returns the bitmap as a <a href="qvariant.html">QVariant</a>.</p>
<h3 class="fn"><a name="operator-eq"></a>QBitmap &amp; QBitmap::operator= ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i> )</h3>
<p>Assigns the given <i>pixmap</i> to this bitmap and returns a reference to this bitmap.</p>
<p>If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.</p>
<p>See also <a href="qpixmap.html#depth">QPixmap::depth</a>().</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QBitmap-6"></a>QBitmap::QBitmap ( int <i>width</i>, int <i>height</i>, bool <i>clear</i> )</h3>
<p>Constructs a bitmap with the given <i>width</i> and <i>height</i>. If <i>clear</i> is true, the bits are initialized to <a href="qt.html#GlobalColor-enum">Qt::color0</a>.</p>
<p>Use the corresponding <a href="qbitmap.html#QBitmap">QBitmap</a>() constructor instead, and then call the <a href="qbitmap.html#clear">clear</a>() function if the <i>clear</i> parameter is true.</p>
<h3 class="fn"><a name="QBitmap-7"></a>QBitmap::QBitmap ( const <a href="qsize.html">QSize</a> &amp; <i>size</i>, bool <i>clear</i> )</h3>
<p>Constructs a bitmap with the given <i>size</i>. If <i>clear</i> is true, the bits are initialized to <a href="qt.html#GlobalColor-enum">Qt::color0</a>.</p>
<p>Use the corresponding <a href="qbitmap.html#QBitmap">QBitmap</a>() constructor instead, and then call the <a href="qbitmap.html#clear">clear</a>() function if the <i>clear</i> parameter is true.</p>
<h3 class="fn"><a name="QBitmap-8"></a>QBitmap::QBitmap ( int <i>width</i>, int <i>height</i>, const <a href="qtglobal.html#uchar-typedef">uchar</a> * <i>bits</i>, bool <i>isXbitmap</i> = false )</h3>
<p>Constructs a bitmap with the given <i>width</i> and <i>height</i>, and sets the contents to the <i>bits</i> supplied. The <i>isXbitmap</i> flag should be true if <i>bits</i> was generated by the X11 bitmap program.</p>
<p>Use the static <a href="qbitmap.html#fromData">fromData</a>() function instead. If <i>isXbitmap</i> is true, use the default bit order(QImage_FormatMonoLSB) otherwise use <a href="qimage.html#Format-enum">QImage::Format_Mono</a>.</p>
<h3 class="fn"><a name="QBitmap-9"></a>QBitmap::QBitmap ( const <a href="qimage.html">QImage</a> &amp; <i>image</i> )</h3>
<p>Constructs a bitmap that is a copy of the given <i>image</i>.</p>
<p>Use the static <a href="qbitmap.html#fromImage">fromImage</a>() function instead.</p>
<h3 class="fn"><a name="QBitmap-10"></a>QBitmap::QBitmap ( const <a href="qsize.html">QSize</a> &amp; <i>size</i>, const <a href="qtglobal.html#uchar-typedef">uchar</a> * <i>bits</i>, bool <i>isXbitmap</i> = false )</h3>
<p>Constructs a bitmap with the given <i>size</i>, and sets the contents to the <i>bits</i> supplied. The <i>isXbitmap</i> flag should be true if <i>bits</i> was generated by the X11 bitmap program.</p>
<p>Use the static <a href="qbitmap.html#fromData">fromData</a>() function instead. If <i>isXbitmap</i> is true, use the default bit order(QImage_FormatMonoLSB) otherwise use <a href="qimage.html#Format-enum">QImage::Format_Mono</a>.</p>
<h3 class="fn"><a name="xForm"></a>QBitmap QBitmap::xForm ( const <a href="qmatrix.html">QMatrix</a> &amp; <i>matrix</i> ) const</h3>
<p>Returns a copy of this bitmap, transformed according to the given <i>matrix</i>.</p>
<p>Use <a href="qbitmap.html#transformed">transformed</a>() instead.</p>
<h3 class="fn"><a name="operator-eq-2"></a>QBitmap &amp; QBitmap::operator= ( const <a href="qimage.html">QImage</a> &amp; <i>image</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Converts the given <i>image</i> to a bitmap, and assigns the result to this bitmap. Returns a reference to the bitmap.</p>
<p>Use the static <a href="qbitmap.html#fromImage">fromImage</a>() function instead.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>