summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqbitmap.3qt
blob: f0477b2f250bf38a48ceafce6737411cb8ea70fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
'\" t
.TH TQBitmap 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQBitmap \- Monochrome (1-bit depth) pixmaps
.SH SYNOPSIS
\fC#include <tqbitmap.h>\fR
.PP
Inherits TQPixmap.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQBitmap\fR ()"
.br
.ti -1c
.BI "\fBTQBitmap\fR ( int w, int h, bool clear = FALSE, TQPixmap::Optimization optimization = TQPixmap::DefaultOptim )"
.br
.ti -1c
.BI "\fBTQBitmap\fR ( const TQSize & size, bool clear = FALSE, TQPixmap::Optimization optimization = TQPixmap::DefaultOptim )"
.br
.ti -1c
.BI "\fBTQBitmap\fR ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )"
.br
.ti -1c
.BI "\fBTQBitmap\fR ( const TQSize & size, const uchar * bits, bool isXbitmap = FALSE )"
.br
.ti -1c
.BI "\fBTQBitmap\fR ( const TQBitmap & bitmap )"
.br
.ti -1c
.BI "\fBTQBitmap\fR ( const TQString & fileName, const char * format = 0 )"
.br
.ti -1c
.BI "TQBitmap & \fBoperator=\fR ( const TQBitmap & bitmap )"
.br
.ti -1c
.BI "TQBitmap & \fBoperator=\fR ( const TQPixmap & pixmap )"
.br
.ti -1c
.BI "TQBitmap & \fBoperator=\fR ( const TQImage & image )"
.br
.ti -1c
.BI "TQBitmap \fBxForm\fR ( const TQWMatrix & matrix ) const"
.br
.in -1c
.SH DESCRIPTION
The TQBitmap class provides monochrome (1-bit depth) pixmaps.
.PP
The TQBitmap class is a monochrome off-screen paint device used mainly for creating custom TQCursor and TQBrush objects, in TQPixmap::setMask() and for TQRegion.
.PP
A TQBitmap is a TQPixmap with a depth of 1. If a pixmap with a depth greater than 1 is assigned to a bitmap, the bitmap will be dithered automatically. A TQBitmap is guaranteed to always have the depth 1, unless it is TQPixmap::isNull() which has depth 0.
.PP
When drawing in a TQBitmap (or TQPixmap with depth 1), we recommend using the TQColor objects \fCQt::color0\fR and \fCQt::color1\fR. Painting with \fCcolor0\fR sets the bitmap bits to 0, and painting with \fCcolor1\fR sets the bits to 1. For a bitmap, 0-bits indicate background (or transparent) and 1-bits indicate foreground (or opaque). Using the \fCblack\fR and \fCwhite\fR TQColor objects make no sense because the TQColor::pixel() value is not necessarily 0 for black and 1 for white.
.PP
The TQBitmap can be transformed (translated, scaled, sheared or rotated) using xForm().
.PP
Just like the TQPixmap class, TQBitmap is optimized by the use of implicit sharing, so it is very efficient to pass TQBitmap objects as arguments.
.PP
See also TQPixmap, TQPainter::drawPixmap(), bitBlt(), Shared Classes, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQBitmap::TQBitmap ()"
Constructs a null bitmap.
.PP
See also TQPixmap::isNull().
.SH "TQBitmap::TQBitmap ( int w, int h, bool clear = FALSE, TQPixmap::Optimization optimization = TQPixmap::DefaultOptim )"
Constructs a bitmap with width \fIw\fR and height \fIh\fR.
.PP
The contents of the bitmap is uninitialized if \fIclear\fR is FALSE; otherwise it is filled with pixel value 0 (the TQColor \fCQt::color0\fR).
.PP
The optional \fIoptimization\fR argument specifies the optimization setting for the bitmap. The default optimization should be used in most cases. Games and other pixmap-intensive applications may benefit from setting this argument; see TQPixmap::Optimization.
.PP
See also TQPixmap::setOptimization() and TQPixmap::setDefaultOptimization().
.SH "TQBitmap::TQBitmap ( const TQSize & size, bool clear = FALSE, TQPixmap::Optimization optimization = TQPixmap::DefaultOptim )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Constructs a bitmap with the size \fIsize\fR.
.PP
The contents of the bitmap is uninitialized if \fIclear\fR is FALSE; otherwise it is filled with pixel value 0 (the TQColor \fCQt::color0\fR).
.PP
The optional \fIoptimization\fR argument specifies the optimization setting for the bitmap. The default optimization should be used in most cases. Games and other pixmap-intensive applications may benefit from setting this argument; see TQPixmap::Optimization.
.SH "TQBitmap::TQBitmap ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )"
Constructs a bitmap with width \fIw\fR and height \fIh\fR and sets the contents to \fIbits\fR.
.PP
The \fIisXbitmap\fR flag should be TRUE if \fIbits\fR was generated by the X11 bitmap program. The X bitmap bit order is little endian. The TQImage documentation discusses bit order of monochrome images.
.PP
Example (creates an arrow bitmap):
.PP
.nf
.br
        uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };
.br
        TQBitmap bm( 8, 8, arrow_bits, TRUE );
.br
.fi
.SH "TQBitmap::TQBitmap ( const TQSize & size, const uchar * bits, bool isXbitmap = FALSE )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Constructs a bitmap with the size \fIsize\fR and sets the contents to \fIbits\fR.
.PP
The \fIisXbitmap\fR flag should be TRUE if \fIbits\fR was generated by the X11 bitmap program. The X bitmap bit order is little endian. The TQImage documentation discusses bit order of monochrome images.
.SH "TQBitmap::TQBitmap ( const TQBitmap & bitmap )"
Constructs a bitmap that is a copy of \fIbitmap\fR.
.SH "TQBitmap::TQBitmap ( const TQString & fileName, const char * format = 0 )"
Constructs a bitmap from the file \fIfileName\fR. If the file does not exist or is of an unknown format, the bitmap becomes a null bitmap.
.PP
The parameters \fIfileName\fR and \fIformat\fR are passed on to TQPixmap::load(). Dithering will be performed if the file format uses more than 1 bit per pixel.
.PP
See also TQPixmap::isNull(), TQPixmap::load(), TQPixmap::loadFromData(), TQPixmap::save(), and TQPixmap::imageFormat().
.SH "TQBitmap & TQBitmap::operator= ( const TQBitmap & bitmap )"
Assigns the bitmap \fIbitmap\fR to this bitmap and returns a reference to this bitmap.
.SH "TQBitmap & TQBitmap::operator= ( const TQPixmap & pixmap )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Assigns the pixmap \fIpixmap\fR to this bitmap and returns a reference to this bitmap.
.PP
Dithering will be performed if the pixmap has a TQPixmap::depth() greater than 1.
.SH "TQBitmap & TQBitmap::operator= ( const TQImage & image )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Converts the image \fIimage\fR to a bitmap and assigns the result to this bitmap. Returns a reference to the bitmap.
.PP
Dithering will be performed if the image has a TQImage::depth() greater than 1.
.SH "TQBitmap TQBitmap::xForm ( const TQWMatrix & matrix ) const"
Returns a transformed copy of this bitmap by using \fImatrix\fR.
.PP
This function does exactly the same as TQPixmap::xForm(), except that it returns a TQBitmap instead of a TQPixmap.
.PP
See also TQPixmap::xForm().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqbitmap.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqbitmap.3qt) and the Qt
version (3.3.8).