QBitmap(3qt)
β¨ QBitmap β¨ β the 3qt manual page, but make it make sense π
okay bestie, sit down, we're learning about QBitmap today and honestly? she's iconic. this is the QBitmap(3qt) page from the Qt docs, rewritten with love and zero skipped details. no cap. π«Ά
πΈ NAME πΈ
QBitmap β monochrome (1-bit depth) pixmaps. that's it. that's the whole vibe. one bit. two moods. π
π SYNOPSIS π
#include <qbitmap.h>
she inherits QPixmap, so everything a pixmap can do, she can do too (with extra monochrome flair) β¨
π Public Members
here's the whole squad, no one left out:
QBitmap ()QBitmap ( int w, int h, bool clear = FALSE, QPixmap::Optimization optimization = QPixmap::DefaultOptim )QBitmap ( const QSize & size, bool clear = FALSE, QPixmap::Optimization optimization = QPixmap::DefaultOptim )QBitmap ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )QBitmap ( const QSize & size, const uchar * bits, bool isXbitmap = FALSE )QBitmap ( const QBitmap & bitmap )QBitmap ( const QString & fileName, const char * format = 0 )QBitmap & operator= ( const QBitmap & bitmap )QBitmap & operator= ( const QPixmap & pixmap )QBitmap & operator= ( const QImage & image )QBitmap xForm ( const QWMatrix & matrix ) const
π¦ DESCRIPTION π¦
so, the QBitmap class provides monochrome (1-bit depth) pixmaps. periodt.
QBitmap is a monochrome off-screen paint device, and like, her whole job? making custom QCursor and QBrush objects, showing up in QPixmap::setMask(), and hanging out with QRegion. main character energy fr fr. π
a QBitmap is literally just a QPixmap with a depth of 1. if you try to assign a pixmap with a depth greater than 1 to a bitmap, the bitmap will be dithered automatically β no drama, she just handles it. and a QBitmap is guaranteed to always have the depth 1, unless it's QPixmap::isNull(), which has depth 0. the one exception. the rule-breaker. π
when you're drawing in a QBitmap (or a QPixmap with depth 1), the recommendation is to use the QColor objects Qt::color0 and Qt::color1. here's the tea:
- painting with
color0sets the bitmap bits to0 - painting with
color1sets the bits to1
for a bitmap, 0-bits mean background (or transparent) and 1-bits mean foreground (or opaque). and using the black and white QColor objects makes no sense, because the QColor::pixel() value is not necessarily 0 for black and 1 for white. don't do it bestie, it's giving chaos. π
the QBitmap can be transformed β translated, scaled, sheared or rotated β using xForm(). glow-up on demand. β¨
and just like QPixmap, QBitmap is optimized by the use of implicit sharing, so passing QBitmap objects as arguments is very efficient. cheap. free. slay. π
See also: QPixmap, QPainter::drawPixmap(), bitBlt(), Shared Classes, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes.
π MEMBER FUNCTION DOCUMENTATION π
QBitmap::QBitmap ()
constructs a null bitmap. she's empty, she's mysterious, she contains multitudes (none of them pixels).
See also: QPixmap::isNull().
QBitmap::QBitmap ( int w, int h, bool clear = FALSE, QPixmap::Optimization optimization = QPixmap::DefaultOptim )
constructs a bitmap with width w and height h. π
the contents of the bitmap is uninitialized if clear is FALSE; otherwise it is filled with pixel value 0 (the QColor Qt::color0).
the optional optimization 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 QPixmap::Optimization if that's your thing.
See also: QPixmap::setOptimization() and QPixmap::setDefaultOptimization().
QBitmap::QBitmap ( const QSize & size, bool clear = FALSE, QPixmap::Optimization optimization = QPixmap::DefaultOptim )
this is an overloaded member function, provided for convenience. it behaves essentially like the above function. (she's the same girl, different outfit π )
constructs a bitmap with the size size.
the contents of the bitmap is uninitialized if clear is FALSE; otherwise it is filled with pixel value 0 (the QColor Qt::color0).
the optional optimization 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 QPixmap::Optimization.
QBitmap::QBitmap ( int w, int h, const uchar * bits, bool isXbitmap = FALSE )
constructs a bitmap with width w and height h and sets the contents to bits. raw data moment. π§
the isXbitmap flag should be TRUE if bits was generated by the X11 bitmap program. the X bitmap bit order is little endian. the QImage documentation discusses bit order of monochrome images β go read it if you want the deep lore, iykyk.
example (creates an arrow bitmap):
uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };
QBitmap bm( 8, 8, arrow_bits, TRUE );
look at her. an arrow. eight by eight. we stan. πΉβ¨
QBitmap::QBitmap ( const QSize & size, const uchar * bits, bool isXbitmap = FALSE )
this is an overloaded member function, provided for convenience. it behaves essentially like the above function.
constructs a bitmap with the size size and sets the contents to bits.
the isXbitmap flag should be TRUE if bits was generated by the X11 bitmap program. the X bitmap bit order is little endian. the QImage documentation discusses bit order of monochrome images.
QBitmap::QBitmap ( const QBitmap & bitmap )
constructs a bitmap that is a copy of bitmap. twin behavior. π―ββοΈ
QBitmap::QBitmap ( const QString & fileName, const char * format = 0 )
constructs a bitmap from the file fileName. if the file does not exist or is of an unknown format, the bitmap becomes a null bitmap. no file, no pixels. π
the parameters fileName and format are passed on to QPixmap::load(). dithering will be performed if the file format uses more than 1 bit per pixel β because she's monochrome and she refuses to be anything else. π
See also: QPixmap::isNull(), QPixmap::load(), QPixmap::loadFromData(), QPixmap::save(), and QPixmap::imageFormat().
QBitmap & QBitmap::operator= ( const QBitmap & bitmap )
assigns the bitmap bitmap to this bitmap and returns a reference to this bitmap. simple. clean. no notes. β¨
QBitmap & QBitmap::operator= ( const QPixmap & pixmap )
this is an overloaded member function, provided for convenience. it behaves essentially like the above function.
assigns the pixmap pixmap to this bitmap and returns a reference to this bitmap.
dithering will be performed if the pixmap has a QPixmap::depth() greater than 1. she's converting. she's adapting. she's that girl. π¦
QBitmap & QBitmap::operator= ( const QImage & image )
this is an overloaded member function, provided for convenience. it behaves essentially like the above function.
converts the image image to a bitmap and assigns the result to this bitmap. returns a reference to the bitmap.
dithering will be performed if the image has a QImage::depth() greater than 1. same energy, different source. π
QBitmap QBitmap::xForm ( const QWMatrix & matrix ) const
returns a transformed copy of this bitmap by using matrix. β¨ transformation arc complete β¨
this function does exactly the same as QPixmap::xForm(), except that it returns a QBitmap instead of a QPixmap. same moves, better fit.
See also: QPixmap::xForm().
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
π AUTHOR π
Generated automatically from the source code. (not a human, not a girlboss, just a script doing its thing π)
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you. π«Ά (fr, they're being so nice about it)
the definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt 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. not me reading the unofficial format π
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qbitmap.3qt) and the Qt version (3.3.8). don't forget those two or they'll be sad π
okay that's the whole page bestie, every flag, every constructor, every warning, nothing skipped, we ate and left no crumbs π β¨
Trolltech AS dropped this on 2 February 2007, and it's the Qt 3.3.8 era of the QBitmap(3qt) page β mwah, iconic, periodt. ππ¦π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms