Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QBitmap

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.gui.QPixmap
                  com.trolltech.qt.gui.QBitmap

All Implemented Interfaces:
  QPaintDeviceInterface, QtJambiInterface, java.lang.Cloneable

    public class QBitmap

extends QPixmap
implements java.lang.Cloneable

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.

See also:
  `QPixmap`, `QImage`, `QImageReader`, and `QImageWriter`.

Nested Class Summary

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

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`.
`static QBitmap` | `fromNativePointer(QNativePointer nativePointer)` This method 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 `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, 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, equals, 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
`getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QBitmap

    public QBitmap()

  Constructs a null bitmap.

See also:
  `QPixmap::isNull()`.

### QBitmap

    public QBitmap(QPixmap arg__1)

  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()`, `fromImage()`, and `fromData()`.

### QBitmap

    public QBitmap(QSize arg__1)

  Constructs a bitmap with the given `size`. The pixels in the bitmap are uninitialized.

See also:
  `clear()`.

### QBitmap

    public QBitmap(int w,
                   int h)

  Constructs a bitmap with the given `width` and `height`. The pixels inside are uninitialized.

See also:
  `clear()`.

### QBitmap

    public QBitmap(java.lang.String fileName,
                   java.lang.String format)

  Constructs a bitmap from the file specified by the given `fileName`. If the file does not exist, or has an unknown format, the bitmap becomes a null bitmap.

  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.

### QBitmap

    public QBitmap(java.lang.String fileName)

  This is an overloaded constructor provided for convenience.

Method Detail

### clear

    public final void clear()

  Clears the bitmap, setting all its bits to `Qt::color0` .

### transformed

    public final QBitmap transformed(QMatrix arg__1)

  This convenience function converts the `matrix` to a `QTransform` and calls the overloaded function.

### transformed

    public final QBitmap transformed(QTransform matrix)

  Returns a copy of this bitmap, transformed according to the given `matrix`.

See also:
  `QPixmap::transformed()`.

### fromImage

    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`.

See also:
  `fromData()`.

### fromNativePointer

    public static QBitmap fromNativePointer(QNativePointer nativePointer)

  This method returns the QBitmap instance pointed to by `nativePointer`.

### nativePointerArray

    public static QNativePointer nativePointerArray(QBitmap[] array)

  This function returns a QNativePointer that is pointing to the specified QBitmap array.

### fromData

    public 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`.

See also:
  `fromData()`.

### fromData

    public static QBitmap fromData(QSize size,
                                   byte[] bits)

  Constructs a bitmap with the given `size`, and sets the contents to the `bits` supplied.

  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.

See also:
  `fromImage()`.

### clone

    public QBitmap clone()

  This method is reimplemented for internal reasons

  Overrides:
    `clone` in class `QPixmap`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD