|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# Qt 3 Support Members for QBitmap

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

- QBitmap class reference

### Public Functions

- QBitmap ( int w, int h, bool clear )
- QBitmap ( const QSize & size, bool clear )
- QBitmap ( int width, int height, const uchar * bits, bool isXbitmap = false )
- QBitmap ( const QImage & image )
- QBitmap ( const QSize & size, const uchar * bits, bool isXbitmap = false )
- QBitmap xForm ( const QMatrix & matrix ) const
- QBitmap & operator= ( const QImage & image )

- 11 public functions inherited from QPixmap
- 8 public functions inherited from QPaintDevice

## Member Function Documentation

### QBitmap::QBitmap ( int w, int h, bool clear )

Use the QBitmap(w, h) constructor. If clear is true, call clear() afterward.

See also clear().

### QBitmap::QBitmap ( const QSize & size, bool clear )

Use the QBitmap(size) constructor. If clear is true, call clear() afterward.

See also clear().

### QBitmap::QBitmap ( int width, int height, const uchar * bits, bool isXbitmap = false )

Constructs a bitmap with the given width and height, and sets the contents to the bits supplied.

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. Opposed to QImage, the data has to be byte aligned.

Example (creates an arrow bitmap):

        uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };
        QBitmap bm(8, 8, arrow_bits, true);

### QBitmap::QBitmap ( const QImage & image )

Constructs a bitmap that is a copy of the image given.

Dithering will be performed if the image has a QImage::depth() greater than 1.

### QBitmap::QBitmap ( const QSize & size, const uchar * bits, bool isXbitmap = false )

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

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::xForm ( const QMatrix & matrix ) const

Use transform(matrix) instead.

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