| def clear () |
| def transformed (arg__1) |
| def transformed (matrix) |
The QBitmap class provides monochrome (1-bit depth) pixmaps.
The QBitmap class is a monochrome off-screen paint device used mainly for creating custom QCursor and QBrush objects, constructing QRegion objects, and for setting masks for pixmaps and widgets.
QBitmap is a QPixmap 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.
Use the QColor objects Qt.color0 and Qt.color1 when drawing on a QBitmap object (or a QPixmap object with depth 1).
Painting with Qt.color0 sets the bitmap bits to 0, and painting with Qt.color1 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 QBitmap.clear() function to set all the bits to Qt.color0 . Note that using the Qt.black and Qt.white colors make no sense because the QColor.pixel() value is not necessarily 0 for black and 1 for white.
The QBitmap class provides the QBitmap.transformed() function returning a transformed copy of the bitmap; use the QTransform argument to translate, scale, shear, and rotate the bitmap. In addition, QBitmap provides the static QBitmap.fromData() function which returns a bitmap constructed from the given uchar data, and the static QBitmap.fromImage() function returning a converted copy of a QImage object.
Just like the QPixmap class, QBitmap is optimized by the use of implicit data sharing. For more information, see the Implicit Data Sharing documentation.
See also
| Parameters: |
|
|---|
Constructs a null bitmap.
See also
Constructs a bitmap that is a copy of the given pixmap .
If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.
See also
QPixmap.depth() QBitmap.fromImage() QBitmap.fromData()
Constructs a bitmap with the given size . The pixels in the bitmap are uninitialized.
See also
Constructs a bitmap with the given width and height . The pixels inside are uninitialized.
See also
| Parameter: | matrix – QTransform |
|---|---|
| Return type: | QBitmap |
Returns a copy of this bitmap, transformed according to the given matrix .
See also
| Parameter: | arg__1 – QMatrix |
|---|---|
| Return type: | QBitmap |
This is an overloaded function.
This convenience function converts the matrix to a QTransform and calls the overloaded function.