⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qbitmap.html

📁 QT 下载资料仅供参考
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qbitmap.cpp:42 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QBitmap Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QBitmap Class Reference</h1><p>The QBitmap class provides monochrome (1-bit depth) pixmaps.<a href="#details">More...</a><p><tt>#include &lt;<a href="qbitmap-h.html">qbitmap.h</a>&gt;</tt><p>Inherits <a href="qpixmap.html">QPixmap</a>.<p><a href="qbitmap-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QBitmap"><b>QBitmap</b></a> ()</div></li><li><div class=fn><a href="#QBitmap-2"><b>QBitmap</b></a> ( int&nbsp;w, int&nbsp;h, bool&nbsp;clear = FALSE, QPixmap::Optimization&nbsp;optimization = QPixmap::DefaultOptim )</div></li><li><div class=fn><a href="#QBitmap-3"><b>QBitmap</b></a> ( const&nbsp;QSize&nbsp;&amp;&nbsp;size, bool&nbsp;clear = FALSE, QPixmap::Optimization&nbsp;optimization = QPixmap::DefaultOptim )</div></li><li><div class=fn><a href="#QBitmap-4"><b>QBitmap</b></a> ( int&nbsp;w, int&nbsp;h, const&nbsp;uchar&nbsp;*&nbsp;bits, bool&nbsp;isXbitmap = FALSE )</div></li><li><div class=fn><a href="#QBitmap-5"><b>QBitmap</b></a> ( const&nbsp;QSize&nbsp;&amp;&nbsp;size, const&nbsp;uchar&nbsp;*&nbsp;bits, bool&nbsp;isXbitmap = FALSE )</div></li><li><div class=fn><a href="#QBitmap-6"><b>QBitmap</b></a> ( const&nbsp;QBitmap&nbsp;&amp;&nbsp;bitmap )</div></li><li><div class=fn><a href="#QBitmap-7"><b>QBitmap</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format = 0 )</div></li><li><div class=fn>QBitmap &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QBitmap&nbsp;&amp;&nbsp;bitmap )</div></li><li><div class=fn>QBitmap &amp; <a href="#operator-eq-2"><b>operator=</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap )</div></li><li><div class=fn>QBitmap &amp; <a href="#operator-eq-3"><b>operator=</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;image )</div></li><li><div class=fn>QBitmap <a href="#xForm"><b>xForm</b></a> ( const&nbsp;QWMatrix&nbsp;&amp;&nbsp;matrix ) const</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QBitmap class provides monochrome (1-bit depth) pixmaps.<p> <p> The QBitmap class is a monochrome off-screen paint device usedmainly for creating custom <a href="qcursor.html">QCursor</a> and <a href="qbrush.html">QBrush</a> objects, in<a href="qpixmap.html#setMask">QPixmap::setMask</a>() and for <a href="qregion.html">QRegion</a>.<p> A QBitmap is a <a href="qpixmap.html">QPixmap</a> with a <a href="qpixmap.html#depth">depth</a>of 1. If a pixmap with a depth greater than 1 is assigned to abitmap, the bitmap will be dithered automatically. A QBitmap isguaranteed to always have the depth 1, unless it is<a href="qpixmap.html#isNull">QPixmap::isNull</a>() which has depth 0.<p> When drawing in a QBitmap (or QPixmap with depth 1), we recommendusing the  <a href="qcolor.html">QColor</a> objects <tt>Qt::color0</tt> and <tt>Qt::color1</tt>.Painting with <tt>color0</tt> sets the bitmap bits to 0, and paintingwith <tt>color1</tt> sets the bits to 1. For a bitmap, 0-bits indicatebackground (or transparent) and 1-bits indicate foreground (oropaque). Using the <tt>black</tt> and <tt>white</tt> QColor objects make nosense because the <a href="qcolor.html#pixel">QColor::pixel</a>() value is not necessarily 0 forblack and 1 for white.<p> The QBitmap can be transformed (translated, scaled, sheared orrotated) using <a href="#xForm">xForm</a>().<p> Just like the <a href="qpixmap.html">QPixmap</a> class, QBitmap is optimized by the use of<a href="shclass.html">implicit sharing</a>, so it is veryefficient to pass QBitmap objects as arguments.<p> <p>See also <a href="qpixmap.html">QPixmap</a>, <a href="qpainter.html#drawPixmap">QPainter::drawPixmap</a>(), <a href="qpaintdevice.html#bitBlt">bitBlt</a>(), <a href="shclass.html">Shared Classes</a>, <a href="graphics.html">Graphics Classes</a>, <a href="images.html">Image Processing Classes</a> and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QBitmap"></a>QBitmap::QBitmap ()</h3>Constructs a null bitmap.<p> <p>See also <a href="qpixmap.html#isNull">QPixmap::isNull</a>().<h3 class=fn><a name="QBitmap-2"></a>QBitmap::QBitmap ( int&nbsp;w, int&nbsp;h, bool&nbsp;clear = FALSE, <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a>&nbsp;optimization = QPixmap::DefaultOptim )</h3>Constructs a bitmap with width <em>w</em> and height <em>h</em>.<p> The contents of the bitmap is uninitialized if <em>clear</em> is FALSE;otherwise it is filled with pixel value 0 (the <a href="qcolor.html">QColor</a> <tt>Qt::color0</tt>).<p> The optional <em>optimization</em> argument specifies the optimizationsetting for the bitmap. The default optimization should be used inmost cases. Games and other pixmap-intensive applications maybenefit from setting this argument; see <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a>.<p> <p>See also <a href="qpixmap.html#setOptimization">QPixmap::setOptimization</a>() and <a href="qpixmap.html#setDefaultOptimization">QPixmap::setDefaultOptimization</a>().<h3 class=fn><a name="QBitmap-3"></a>QBitmap::QBitmap ( const&nbsp;<a href="qsize.html">QSize</a>&nbsp;&amp;&nbsp;size, bool&nbsp;clear = FALSE, <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a>&nbsp;optimization = QPixmap::DefaultOptim )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Constructs a bitmap with the size <em>size</em>.<p> The contents of the bitmap is uninitialized if <em>clear</em> is FALSE;otherwise it is filled with pixel value 0 (the <a href="qcolor.html">QColor</a> <tt>Qt::color0</tt>).<p> The optional <em>optimization</em> argument specifies the optimizationsetting for the bitmap. The default optimization should be used inmost cases. Games and other pixmap-intensive applications maybenefit from setting this argument; see <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a>.<h3 class=fn><a name="QBitmap-4"></a>QBitmap::QBitmap ( int&nbsp;w, int&nbsp;h, const&nbsp;uchar&nbsp;*&nbsp;bits, bool&nbsp;isXbitmap = FALSE )</h3>Constructs a bitmap with width <em>w</em> and height <em>h</em> and sets thecontents to <em>bits</em>.<p> The <em>isXbitmap</em> flag should be TRUE if <em>bits</em> was generated bythe X11 bitmap program. The X bitmap bit order is little endian.The <a href="qimage.html">QImage</a> documentation discusses bit order of monochrome images.<p> Example (creates an arrow bitmap):<pre>        uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };        QBitmap bm( 8, 8, arrow_bits, TRUE );    </pre> <h3 class=fn><a name="QBitmap-5"></a>QBitmap::QBitmap ( const&nbsp;<a href="qsize.html">QSize</a>&nbsp;&amp;&nbsp;size, const&nbsp;uchar&nbsp;*&nbsp;bits, bool&nbsp;isXbitmap = FALSE )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Constructs a bitmap with the size <em>size</em> and sets the contents to<em>bits</em>.<p> The <em>isXbitmap</em> flag should be TRUE if <em>bits</em> was generated bythe X11 bitmap program. The X bitmap bit order is little endian.The <a href="qimage.html">QImage</a> documentation discusses bit order of monochrome images.<h3 class=fn><a name="QBitmap-6"></a>QBitmap::QBitmap ( const&nbsp;<a href="qbitmap.html">QBitmap</a>&nbsp;&amp;&nbsp;bitmap )</h3>Constructs a bitmap that is a copy of <em>bitmap</em>.<h3 class=fn><a name="QBitmap-7"></a>QBitmap::QBitmap ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName, const&nbsp;char&nbsp;*&nbsp;format = 0 )</h3>Constructs a pixmap from the file <em>fileName</em>. If the file doesnot exist or is of an unknown format, the bitmap becomes a nullbitmap.<p> The parameters <em>fileName</em> and <em>format</em> are passed on to<a href="qpixmap.html#load">QPixmap::load</a>(). Dithering will be performed if the file formatuses more than 1 bit per pixel.<p> <p>See also <a href="qpixmap.html#isNull">QPixmap::isNull</a>(), <a href="qpixmap.html#load">QPixmap::load</a>(), <a href="qpixmap.html#loadFromData">QPixmap::loadFromData</a>(), <a href="qpixmap.html#save">QPixmap::save</a>() and <a href="qpixmap.html#imageFormat">QPixmap::imageFormat</a>().<h3 class=fn><a href="qbitmap.html">QBitmap</a>&nbsp;&amp; <a name="operator-eq"></a>QBitmap::operator= ( const&nbsp;<a href="qbitmap.html">QBitmap</a>&nbsp;&amp;&nbsp;bitmap )</h3>Assigns the bitmap <em>bitmap</em> to this bitmap and returns areference to this bitmap.<h3 class=fn><a href="qbitmap.html">QBitmap</a>&nbsp;&amp; <a name="operator-eq-2"></a>QBitmap::operator= ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Assigns the pixmap <em>pixmap</em> to this bitmap and returns areference to this bitmap.<p> Dithering will be performed if the pixmap has a <a href="qpixmap.html#depth">QPixmap::depth</a>()greater than 1.<h3 class=fn><a href="qbitmap.html">QBitmap</a>&nbsp;&amp; <a name="operator-eq-3"></a>QBitmap::operator= ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;image )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Converts the image <em>image</em> to a bitmap and assigns the result tothis bitmap. Returns a reference to the bitmap.<p> Dithering will be performed if the image has a <a href="qimage.html#depth">QImage::depth</a>()greater than 1.<h3 class=fn><a href="qbitmap.html">QBitmap</a> <a name="xForm"></a>QBitmap::xForm ( const&nbsp;<a href="qwmatrix.html">QWMatrix</a>&nbsp;&amp;&nbsp;matrix ) const</h3>Returns a transformed copy of this bitmap by using <em>matrix</em>.<p> This function does exactly the same as <a href="qpixmap.html#xForm">QPixmap::xForm</a>(), exceptthat it returns a QBitmap instead of a <a href="qpixmap.html">QPixmap</a>.<p> <p>See also <a href="qpixmap.html#xForm">QPixmap::xForm</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -