QBitmap Class Reference


The QBitmap class provides monochrome (1 bit depth) pixmaps. (details) (complete member list)

#include <qbitmap.h>

Inherits QPixmap.

Public Members


Detailed Description

The QBitmap class provides monochrome (1 bit depth) pixmaps.

The QBitmap class is normally used for creating a custom mouse cursor (QCursor) or creating a special brush (QBrush).


Member Function Documentation

QBitmap::QBitmap (int w, int h, const char *bits, bool isXbitmap=FALSE)

Constructs a bitmap with w width and h height and sets the contents to bits.

The isXbitmap should be TRUE if bits was generated by the X-Windows bitmap program. The X bitmap bit order is little endian. The QImage documentation discusses bit order of monochrome images.

Example (creates an X arrow bitmap):

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

QBitmap::QBitmap (const QSize &sz, const char *bits, bool isXbitmap=FALSE)

Constructs a bitmap with size sz and sets the contents to bits.

The isXbitmap should be TRUE if bits was generated by the X-Windows bitmap program. The X bitmap bit order is little endian. The QImage documentation discusses bit order of monochrome images.

Example (creates an X arrow bitmap):

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

QBitmap::QBitmap (const QBitmap &bm)

Constructs a bitmap which is a copy of bm.

QBitmap::QBitmap ()

Constructs a null bitmap.

See also: QPixmap::isNull().

QBitmap::QBitmap (int w, int h, bool clear = FALSE)

Constructs a bitmap with w width and h height.

The contents of the bitmap is uninitialized if clear is FALSE, otherwise it is filled with pixel value 0.

QBitmap::QBitmap (const QSize &sz, bool clear = FALSE)

Constructs a bitmap with size sz.

The contents of the bitmap is uninitialized if clear is FALSE, otherwise it is filled with pixel value 0.

QBitmap QBitmap::copy () const

Returns a deep copy of the bitmap. All pixels are copied using bitBlt().

See also: operator=().

QBitmap & QBitmap::operator= (const QBitmap &bm)

Assigns the bitmap bm to this bitmap and returns a reference to this bitmap.

QBitmap & QBitmap::operator= (const QImage &im)

Converts the image im to a bitmap that is assigned to this bitmap. Returns a reference to the bitmap.

Dithering will be performed if the image has a depth > 1.


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 16:17, 1995/06/30 by the webmaster at Troll Tech