1QBitmap(3qt)                                                      QBitmap(3qt)
2
3
4

NAME

6       QBitmap - Monochrome (1-bit depth) pixmaps
7

SYNOPSIS

9       #include <qbitmap.h>
10
11       Inherits QPixmap.
12
13   Public Members
14       QBitmap ()
15       QBitmap ( int w, int h, bool clear = FALSE, QPixmap::Optimization
16           optimization = QPixmap::DefaultOptim )
17       QBitmap ( const QSize & size, bool clear = FALSE, QPixmap::Optimization
18           optimization = QPixmap::DefaultOptim )
19       QBitmap ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )
20       QBitmap ( const QSize & size, const uchar * bits, bool isXbitmap =
21           FALSE )
22       QBitmap ( const QBitmap & bitmap )
23       QBitmap ( const QString & fileName, const char * format = 0 )
24       QBitmap & operator= ( const QBitmap & bitmap )
25       QBitmap & operator= ( const QPixmap & pixmap )
26       QBitmap & operator= ( const QImage & image )
27       QBitmap xForm ( const QWMatrix & matrix ) const
28

DESCRIPTION

30       The QBitmap class provides monochrome (1-bit depth) pixmaps.
31
32       The QBitmap class is a monochrome off-screen paint device used mainly
33       for creating custom QCursor and QBrush objects, in QPixmap::setMask()
34       and for QRegion.
35
36       A QBitmap is a QPixmap with a depth of 1. If a pixmap with a depth
37       greater than 1 is assigned to a bitmap, the bitmap will be dithered
38       automatically. A QBitmap is guaranteed to always have the depth 1,
39       unless it is QPixmap::isNull() which has depth 0.
40
41       When drawing in a QBitmap (or QPixmap with depth 1), we recommend using
42       the QColor objects Qt::color0 and Qt::color1. Painting with color0 sets
43       the bitmap bits to 0, and painting with color1 sets the bits to 1. For
44       a bitmap, 0-bits indicate background (or transparent) and 1-bits
45       indicate foreground (or opaque). Using the black and white QColor
46       objects make no sense because the QColor::pixel() value is not
47       necessarily 0 for black and 1 for white.
48
49       The QBitmap can be transformed (translated, scaled, sheared or rotated)
50       using xForm().
51
52       Just like the QPixmap class, QBitmap is optimized by the use of
53       implicit sharing, so it is very efficient to pass QBitmap objects as
54       arguments.
55
56       See also QPixmap, QPainter::drawPixmap(), bitBlt(), Shared Classes,
57       Graphics Classes, Image Processing Classes, and Implicitly and
58       Explicitly Shared Classes.
59

MEMBER FUNCTION DOCUMENTATION

QBitmap::QBitmap ()

62       Constructs a null bitmap.
63
64       See also QPixmap::isNull().
65

QBitmap::QBitmap ( int w, int h, bool clear = FALSE, QPixmap::Optimization

67       optimization = QPixmap::DefaultOptim )
68       Constructs a bitmap with width w and height h.
69
70       The contents of the bitmap is uninitialized if clear is FALSE;
71       otherwise it is filled with pixel value 0 (the QColor Qt::color0).
72
73       The optional optimization argument specifies the optimization setting
74       for the bitmap. The default optimization should be used in most cases.
75       Games and other pixmap-intensive applications may benefit from setting
76       this argument; see QPixmap::Optimization.
77
78       See also QPixmap::setOptimization() and
79       QPixmap::setDefaultOptimization().
80

QBitmap::QBitmap ( const QSize & size, bool clear = FALSE,

82       QPixmap::Optimization optimization = QPixmap::DefaultOptim )
83       This is an overloaded member function, provided for convenience. It
84       behaves essentially like the above function.
85
86       Constructs a bitmap with the size size.
87
88       The contents of the bitmap is uninitialized if clear is FALSE;
89       otherwise it is filled with pixel value 0 (the QColor Qt::color0).
90
91       The optional optimization argument specifies the optimization setting
92       for the bitmap. The default optimization should be used in most cases.
93       Games and other pixmap-intensive applications may benefit from setting
94       this argument; see QPixmap::Optimization.
95

QBitmap::QBitmap ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )

97       Constructs a bitmap with width w and height h and sets the contents to
98       bits.
99
100       The isXbitmap flag should be TRUE if bits was generated by the X11
101       bitmap program. The X bitmap bit order is little endian. The QImage
102       documentation discusses bit order of monochrome images.
103
104       Example (creates an arrow bitmap):
105
106               uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };
107               QBitmap bm( 8, 8, arrow_bits, TRUE );
108

QBitmap::QBitmap ( const QSize & size, const uchar * bits, bool isXbitmap =

110       FALSE )
111       This is an overloaded member function, provided for convenience. It
112       behaves essentially like the above function.
113
114       Constructs a bitmap with the size size and sets the contents to bits.
115
116       The isXbitmap flag should be TRUE if bits was generated by the X11
117       bitmap program. The X bitmap bit order is little endian. The QImage
118       documentation discusses bit order of monochrome images.
119

QBitmap::QBitmap ( const QBitmap & bitmap )

121       Constructs a bitmap that is a copy of bitmap.
122

QBitmap::QBitmap ( const QString & fileName, const char * format = 0 )

124       Constructs a bitmap from the file fileName. If the file does not exist
125       or is of an unknown format, the bitmap becomes a null bitmap.
126
127       The parameters fileName and format are passed on to QPixmap::load().
128       Dithering will be performed if the file format uses more than 1 bit per
129       pixel.
130
131       See also QPixmap::isNull(), QPixmap::load(), QPixmap::loadFromData(),
132       QPixmap::save(), and QPixmap::imageFormat().
133

QBitmap & QBitmap::operator= ( const QBitmap & bitmap )

135       Assigns the bitmap bitmap to this bitmap and returns a reference to
136       this bitmap.
137

QBitmap & QBitmap::operator= ( const QPixmap & pixmap )

139       This is an overloaded member function, provided for convenience. It
140       behaves essentially like the above function.
141
142       Assigns the pixmap pixmap to this bitmap and returns a reference to
143       this bitmap.
144
145       Dithering will be performed if the pixmap has a QPixmap::depth()
146       greater than 1.
147

QBitmap & QBitmap::operator= ( const QImage & image )

149       This is an overloaded member function, provided for convenience. It
150       behaves essentially like the above function.
151
152       Converts the image image to a bitmap and assigns the result to this
153       bitmap. Returns a reference to the bitmap.
154
155       Dithering will be performed if the image has a QImage::depth() greater
156       than 1.
157

QBitmap QBitmap::xForm ( const QWMatrix & matrix ) const

159       Returns a transformed copy of this bitmap by using matrix.
160
161       This function does exactly the same as QPixmap::xForm(), except that it
162       returns a QBitmap instead of a QPixmap.
163
164       See also QPixmap::xForm().
165
166

SEE ALSO

168       http://doc.trolltech.com/qbitmap.html
169       http://www.trolltech.com/faq/tech.html
170
172       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
173       license file included in the distribution for a complete license
174       statement.
175

AUTHOR

177       Generated automatically from the source code.
178

BUGS

180       If you find a bug in Qt, please report it as described in
181       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
182       help you. Thank you.
183
184       The definitive Qt documentation is provided in HTML format; it is
185       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
186       web browser. This man page is provided as a convenience for those users
187       who prefer man pages, although this format is not officially supported
188       by Trolltech.
189
190       If you find errors in this manual page, please report them to qt-
191       bugs@trolltech.com.  Please include the name of the manual page
192       (qbitmap.3qt) and the Qt version (3.3.8).
193
194
195
196Trolltech AS                    2 February 2007                   QBitmap(3qt)
Impressum