|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QPixmap
com.trolltech.qt.gui.QBitmap
public class QBitmap
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 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 transformed() function returning a transformed copy of the bitmap; use the QMatrix argument to translate, scale, shear, and rotate the bitmap. In addition, QBitmap provides the static fromData() function which returns a bitmap constructed from the given uchar data, and the static 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.
QPixmap, QImage, QImageReader, and QImageWriter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
|---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
| Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
|---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
| Field Summary |
|---|
| Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
|---|
currentSender |
| Constructor Summary | |
|---|---|
QBitmap()
Constructs a null bitmap. |
|
QBitmap(int w,
int h)
Constructs a bitmap with the given width and height. |
|
QBitmap(QPixmap arg__1)
Constructs a bitmap that is a copy of the given pixmap. |
|
QBitmap(QSize arg__1)
Constructs a bitmap with the given size. |
|
QBitmap(java.lang.String fileName)
This is an overloaded constructor provided for convenience. |
|
QBitmap(java.lang.String fileName,
java.lang.String format)
Constructs a bitmap from the file specified by the given fileName. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the bitmap, setting all its bits to Qt::color0 . |
QBitmap |
clone()
This method is reimplemented for internal reasons |
static QBitmap |
fromData(QSize size,
byte[] bits)
Constructs a bitmap with the given size, and sets the contents to the bits supplied. |
static QBitmap |
fromData(QSize size,
byte[] bits,
QImage.Format monoFormat)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags. |
static QBitmap |
fromImage(QImage image,
Qt.ImageConversionFlags flags)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags. |
QBitmap |
transformed(QMatrix arg__1)
This convenience function converts the matrix to a QTransform and calls the overloaded function. |
QBitmap |
transformed(QTransform matrix)
Returns a copy of this bitmap, transformed according to the given matrix. |
| Methods inherited from class com.trolltech.qt.gui.QPixmap |
|---|
alphaChannel, cacheKey, copy, copy, copy, createHeuristicMask, createHeuristicMask, createMaskFromColor, createMaskFromColor, defaultDepth, depth, fill, fill, fill, fill, fromImage, fromImage, grabWidget, grabWidget, grabWidget, grabWidget, grabWidget, grabWidget, grabWindow, grabWindow, grabWindow, grabWindow, grabWindow, hasAlpha, hasAlphaChannel, height, heightMM, isNull, isQBitmap, load, load, load, load, loadFromData, loadFromData, loadFromData, loadFromData, loadFromData, loadFromData, loadFromData, loadFromData, logicalDpiX, logicalDpiY, mask, metric, numColors, paintEngine, paintingActive, physicalDpiX, physicalDpiY, readFrom, rect, save, save, save, save, save, save, scaled, scaled, scaled, scaled, scaled, scaled, scaledToHeight, scaledToHeight, scaledToWidth, scaledToWidth, setAlphaChannel, setMask, size, toImage, transformed, transformed, trueMatrix, trueMatrix, width, widthMM, writeTo |
| Methods inherited from class com.trolltech.qt.QtJambiObject |
|---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
| Methods inherited from class com.trolltech.qt.QSignalEmitter |
|---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
| Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
|---|
__qt_signalInitialization |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.trolltech.qt.QtJambiInterface |
|---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
| Constructor Detail |
|---|
public QBitmap()
QPixmap::isNull().
public QBitmap(QPixmap arg__1)
If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.
QPixmap::depth(), fromImage(), and fromData().
public QBitmap(QSize arg__1)
clear().
public QBitmap(int w,
int h)
clear().
public QBitmap(java.lang.String fileName,
java.lang.String format)
The fileName and format parameters are passed on to the QPixmap::load() function. If the file format uses more than 1 bit per pixel, the resulting bitmap will be dithered automatically.
public QBitmap(java.lang.String fileName)
| Method Detail |
|---|
public final void clear()
Qt::color0 .
public final QBitmap transformed(QMatrix arg__1)
QTransform and calls the overloaded function.
public final QBitmap transformed(QTransform matrix)
QPixmap::transformed().
public static QBitmap fromImage(QImage image,
Qt.ImageConversionFlags flags)
fromData().
public static QBitmap fromData(QSize size,
byte[] bits,
QImage.Format monoFormat)
fromData().
public static QBitmap fromData(QSize size,
byte[] bits)
The bitmap data has to be byte aligned and provided in in the bit order specified by monoFormat. The mono format must be either QImage::Format_Mono or QImage::Format_MonoLSB . Use QImage::Format_Mono to specify data on the XBM format.
fromImage().
public QBitmap clone()
clone in class QPixmap
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||