|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QBitmap()
Constructs a null bitmap. |
|
QBitmap(int w,
int h)
Constructs a bitmap with the given w and h. |
|
QBitmap(QPixmap arg__1)
Constructs a bitmap that is a copy of the given arg__1. |
|
QBitmap(QSize arg__1)
Constructs a bitmap with the given arg__1. |
|
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. |
static QBitmap |
fromData(QSize size,
byte[] bits)
This is an overloaded constructor provided for convenience. |
static QBitmap |
fromData(QSize size,
byte[] bits,
QImage.Format monoFormat)
Constructs a bitmap with the given size, and sets the contents to the bits supplied. |
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. |
static QBitmap |
fromNativePointer(QNativePointer nativePointer)
This function returns the QBitmap instance pointed to by nativePointer |
static QNativePointer |
nativePointerArray(QBitmap[] array)
This function returns a QNativePointer that is pointing to the specified QBitmap array. |
QBitmap |
transformed(QMatrix arg__1)
This convenience function converts the arg__1 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, devType, 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, nativePointerArray, 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, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, 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 arg__1)
Constructs a bitmap that is a copy of the given arg__1.
If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.
public QBitmap(QSize arg__1)
Constructs a bitmap with the given arg__1. The pixels in the bitmap are uninitialized.
public QBitmap(int w, int h)
Constructs a bitmap with the given w and h. The pixels inside are uninitialized.
public QBitmap()
Constructs a null bitmap.
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()
Clears the bitmap, setting all its bits to Qt::color0.
public final QBitmap transformed(QMatrix arg__1)
This convenience function converts the arg__1 to a QTransform and calls the overloaded function.
public final QBitmap transformed(QTransform matrix)
Returns a copy of this bitmap, transformed according to the given matrix.
public 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.
public static QBitmap fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QBitmap[] array)
array
- the array that the returned pointer will point to.
public static QBitmap fromData(QSize size, byte[] bits, QImage.Format monoFormat)
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.
public static QBitmap fromData(QSize size, byte[] bits)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |