1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qbitmap.cpp:42 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QBitmap Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QBitmap Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QBitmap class provides monochrome (1-bit depth) pixmaps.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qbitmap-h.html">qbitmap.h</a>></tt>
|
---|
37 | <p>Inherits <a href="qpixmap.html">QPixmap</a>.
|
---|
38 | <p><a href="qbitmap-members.html">List of all member functions.</a>
|
---|
39 | <h2>Public Members</h2>
|
---|
40 | <ul>
|
---|
41 | <li class=fn><a href="#QBitmap"><b>QBitmap</b></a> ()</li>
|
---|
42 | <li class=fn><a href="#QBitmap-2"><b>QBitmap</b></a> ( int w, int h, bool clear = FALSE, QPixmap::Optimization optimization = QPixmap::DefaultOptim )</li>
|
---|
43 | <li class=fn><a href="#QBitmap-3"><b>QBitmap</b></a> ( const QSize & size, bool clear = FALSE, QPixmap::Optimization optimization = QPixmap::DefaultOptim )</li>
|
---|
44 | <li class=fn><a href="#QBitmap-4"><b>QBitmap</b></a> ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )</li>
|
---|
45 | <li class=fn><a href="#QBitmap-5"><b>QBitmap</b></a> ( const QSize & size, const uchar * bits, bool isXbitmap = FALSE )</li>
|
---|
46 | <li class=fn><a href="#QBitmap-6"><b>QBitmap</b></a> ( const QBitmap & bitmap )</li>
|
---|
47 | <li class=fn><a href="#QBitmap-7"><b>QBitmap</b></a> ( const QString & fileName, const char * format = 0 )</li>
|
---|
48 | <li class=fn>QBitmap & <a href="#operator-eq"><b>operator=</b></a> ( const QBitmap & bitmap )</li>
|
---|
49 | <li class=fn>QBitmap & <a href="#operator-eq-2"><b>operator=</b></a> ( const QPixmap & pixmap )</li>
|
---|
50 | <li class=fn>QBitmap & <a href="#operator-eq-3"><b>operator=</b></a> ( const QImage & image )</li>
|
---|
51 | <li class=fn>QBitmap <a href="#xForm"><b>xForm</b></a> ( const QWMatrix & matrix ) const</li>
|
---|
52 | </ul>
|
---|
53 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
54 |
|
---|
55 |
|
---|
56 | The QBitmap class provides monochrome (1-bit depth) pixmaps.
|
---|
57 | <p>
|
---|
58 |
|
---|
59 |
|
---|
60 | <p> The QBitmap class is a monochrome off-screen paint device used
|
---|
61 | mainly for creating custom <a href="qcursor.html">QCursor</a> and <a href="qbrush.html">QBrush</a> objects, in
|
---|
62 | <a href="qpixmap.html#setMask">QPixmap::setMask</a>() and for <a href="qregion.html">QRegion</a>.
|
---|
63 | <p> A QBitmap is a <a href="qpixmap.html">QPixmap</a> with a <a href="qpixmap.html#depth">depth</a>
|
---|
64 | of 1. If a pixmap with a depth greater than 1 is assigned to a
|
---|
65 | bitmap, the bitmap will be dithered automatically. A QBitmap is
|
---|
66 | guaranteed to always have the depth 1, unless it is
|
---|
67 | <a href="qpixmap.html#isNull">QPixmap::isNull</a>() which has depth 0.
|
---|
68 | <p> When drawing in a QBitmap (or QPixmap with depth 1), we recommend
|
---|
69 | using the <a href="qcolor.html">QColor</a> objects <tt>Qt::color0</tt> and <tt>Qt::color1</tt>.
|
---|
70 | Painting with <tt>color0</tt> sets the bitmap bits to 0, and painting
|
---|
71 | with <tt>color1</tt> sets the bits to 1. For a bitmap, 0-bits indicate
|
---|
72 | background (or transparent) and 1-bits indicate foreground (or
|
---|
73 | opaque). Using the <tt>black</tt> and <tt>white</tt> QColor objects make no
|
---|
74 | sense because the <a href="qcolor.html#pixel">QColor::pixel</a>() value is not necessarily 0 for
|
---|
75 | black and 1 for white.
|
---|
76 | <p> The QBitmap can be transformed (translated, scaled, sheared or
|
---|
77 | rotated) using <a href="#xForm">xForm</a>().
|
---|
78 | <p> Just like the <a href="qpixmap.html">QPixmap</a> class, QBitmap is optimized by the use of
|
---|
79 | <a href="shclass.html">implicit sharing</a>, so it is very
|
---|
80 | efficient to pass QBitmap objects as arguments.
|
---|
81 | <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>.
|
---|
82 |
|
---|
83 | <hr><h2>Member Function Documentation</h2>
|
---|
84 | <h3 class=fn><a name="QBitmap"></a>QBitmap::QBitmap ()
|
---|
85 | </h3>
|
---|
86 | Constructs a null bitmap.
|
---|
87 | <p> <p>See also <a href="qpixmap.html#isNull">QPixmap::isNull</a>().
|
---|
88 |
|
---|
89 | <h3 class=fn><a name="QBitmap-2"></a>QBitmap::QBitmap ( int w, int h, bool clear = FALSE, <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a> optimization = QPixmap::DefaultOptim )
|
---|
90 | </h3>
|
---|
91 | Constructs a bitmap with width <em>w</em> and height <em>h</em>.
|
---|
92 | <p> The contents of the bitmap is uninitialized if <em>clear</em> is FALSE;
|
---|
93 | otherwise it is filled with pixel value 0 (the <a href="qcolor.html">QColor</a> <tt>Qt::color0</tt>).
|
---|
94 | <p> The optional <em>optimization</em> argument specifies the optimization
|
---|
95 | setting for the bitmap. The default optimization should be used in
|
---|
96 | most cases. Games and other pixmap-intensive applications may
|
---|
97 | benefit from setting this argument; see <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a>.
|
---|
98 | <p> <p>See also <a href="qpixmap.html#setOptimization">QPixmap::setOptimization</a>() and <a href="qpixmap.html#setDefaultOptimization">QPixmap::setDefaultOptimization</a>().
|
---|
99 |
|
---|
100 | <h3 class=fn><a name="QBitmap-3"></a>QBitmap::QBitmap ( const <a href="qsize.html">QSize</a> & size, bool clear = FALSE, <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a> optimization = QPixmap::DefaultOptim )
|
---|
101 | </h3>
|
---|
102 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
103 | <p> Constructs a bitmap with the size <em>size</em>.
|
---|
104 | <p> The contents of the bitmap is uninitialized if <em>clear</em> is FALSE;
|
---|
105 | otherwise it is filled with pixel value 0 (the <a href="qcolor.html">QColor</a> <tt>Qt::color0</tt>).
|
---|
106 | <p> The optional <em>optimization</em> argument specifies the optimization
|
---|
107 | setting for the bitmap. The default optimization should be used in
|
---|
108 | most cases. Games and other pixmap-intensive applications may
|
---|
109 | benefit from setting this argument; see <a href="qpixmap.html#Optimization-enum">QPixmap::Optimization</a>.
|
---|
110 |
|
---|
111 | <h3 class=fn><a name="QBitmap-4"></a>QBitmap::QBitmap ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )
|
---|
112 | </h3>
|
---|
113 | Constructs a bitmap with width <em>w</em> and height <em>h</em> and sets the
|
---|
114 | contents to <em>bits</em>.
|
---|
115 | <p> The <em>isXbitmap</em> flag should be TRUE if <em>bits</em> was generated by
|
---|
116 | the X11 bitmap program. The X bitmap bit order is little endian.
|
---|
117 | The <a href="qimage.html">QImage</a> documentation discusses bit order of monochrome images.
|
---|
118 | <p> Example (creates an arrow bitmap):
|
---|
119 | <pre>
|
---|
120 | uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };
|
---|
121 | QBitmap bm( 8, 8, arrow_bits, TRUE );
|
---|
122 | </pre>
|
---|
123 |
|
---|
124 |
|
---|
125 | <h3 class=fn><a name="QBitmap-5"></a>QBitmap::QBitmap ( const <a href="qsize.html">QSize</a> & size, const uchar * bits, bool isXbitmap = FALSE )
|
---|
126 | </h3>
|
---|
127 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
128 | <p> Constructs a bitmap with the size <em>size</em> and sets the contents to
|
---|
129 | <em>bits</em>.
|
---|
130 | <p> The <em>isXbitmap</em> flag should be TRUE if <em>bits</em> was generated by
|
---|
131 | the X11 bitmap program. The X bitmap bit order is little endian.
|
---|
132 | The <a href="qimage.html">QImage</a> documentation discusses bit order of monochrome images.
|
---|
133 |
|
---|
134 | <h3 class=fn><a name="QBitmap-6"></a>QBitmap::QBitmap ( const <a href="qbitmap.html">QBitmap</a> & bitmap )
|
---|
135 | </h3>
|
---|
136 | Constructs a bitmap that is a copy of <em>bitmap</em>.
|
---|
137 |
|
---|
138 | <h3 class=fn><a name="QBitmap-7"></a>QBitmap::QBitmap ( const <a href="qstring.html">QString</a> & fileName, const char * format = 0 )
|
---|
139 | </h3>
|
---|
140 | Constructs a bitmap from the file <em>fileName</em>. If the file does
|
---|
141 | not exist or is of an unknown format, the bitmap becomes a null
|
---|
142 | bitmap.
|
---|
143 | <p> The parameters <em>fileName</em> and <em>format</em> are passed on to
|
---|
144 | <a href="qpixmap.html#load">QPixmap::load</a>(). Dithering will be performed if the file format
|
---|
145 | uses more than 1 bit per pixel.
|
---|
146 | <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>().
|
---|
147 |
|
---|
148 | <h3 class=fn><a href="qbitmap.html">QBitmap</a> & <a name="operator-eq"></a>QBitmap::operator= ( const <a href="qbitmap.html">QBitmap</a> & bitmap )
|
---|
149 | </h3>
|
---|
150 | Assigns the bitmap <em>bitmap</em> to this bitmap and returns a
|
---|
151 | reference to this bitmap.
|
---|
152 |
|
---|
153 | <h3 class=fn><a href="qbitmap.html">QBitmap</a> & <a name="operator-eq-2"></a>QBitmap::operator= ( const <a href="qpixmap.html">QPixmap</a> & pixmap )
|
---|
154 | </h3>
|
---|
155 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
156 | <p> Assigns the pixmap <em>pixmap</em> to this bitmap and returns a
|
---|
157 | reference to this bitmap.
|
---|
158 | <p> Dithering will be performed if the pixmap has a <a href="qpixmap.html#depth">QPixmap::depth</a>()
|
---|
159 | greater than 1.
|
---|
160 |
|
---|
161 | <h3 class=fn><a href="qbitmap.html">QBitmap</a> & <a name="operator-eq-3"></a>QBitmap::operator= ( const <a href="qimage.html">QImage</a> & image )
|
---|
162 | </h3>
|
---|
163 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
164 | <p> Converts the image <em>image</em> to a bitmap and assigns the result to
|
---|
165 | this bitmap. Returns a reference to the bitmap.
|
---|
166 | <p> Dithering will be performed if the image has a <a href="qimage.html#depth">QImage::depth</a>()
|
---|
167 | greater than 1.
|
---|
168 |
|
---|
169 | <h3 class=fn><a href="qbitmap.html">QBitmap</a> <a name="xForm"></a>QBitmap::xForm ( const <a href="qwmatrix.html">QWMatrix</a> & matrix ) const
|
---|
170 | </h3>
|
---|
171 | Returns a transformed copy of this bitmap by using <em>matrix</em>.
|
---|
172 | <p> This function does exactly the same as <a href="qpixmap.html#xForm">QPixmap::xForm</a>(), except
|
---|
173 | that it returns a QBitmap instead of a <a href="qpixmap.html">QPixmap</a>.
|
---|
174 | <p> <p>See also <a href="qpixmap.html#xForm">QPixmap::xForm</a>().
|
---|
175 |
|
---|
176 | <!-- eof -->
|
---|
177 | <hr><p>
|
---|
178 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
179 | Copyright © 1995-2007
|
---|
180 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
181 | <table width=100% cellspacing=0 border=0><tr>
|
---|
182 | <td>Copyright © 2007
|
---|
183 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
184 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
185 | </table></div></address></body>
|
---|
186 | </html>
|
---|