Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
QtGui.QBitmap Class Reference

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

Inheritance diagram for QtGui.QBitmap:
Collaboration diagram for QtGui.QBitmap:

Public Member Functions

 QBitmap ()
  More...
 
 QBitmap (QPixmap pixmap)
  More...
 
 QBitmap (QSize size)
  More...
 
 QBitmap (int w, int h)
  More...
 
 QBitmap (string fileName, string format=null)
  More...
 
override void CreateProxy ()
 
new void Clear ()
  More...
 
new void Swap (QBitmap other)
  More...
 
new QBitmap Transformed (QMatrix matrix)
  More...
 
new QBitmap Transformed (QTransform matrix)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QPixmap
 QPixmap ()
  More...
 
 QPixmap (QSize size)
  More...
 
 QPixmap (QPixmap pixmap)
  More...
 
 QPixmap (int w, int h)
  More...
 
 QPixmap (string fileName, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
override void CreateProxy ()
 
new bool ConvertFromImage (QImage img, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
new QPixmap Copy ()
  More...
 
new QPixmap Copy (QRect rect)
  More...
 
new QPixmap Copy (int x, int y, int width, int height)
  More...
 
new QBitmap CreateHeuristicMask (bool clipTight=true)
  More...
 
new QBitmap CreateMaskFromColor (QColor maskColor)
  More...
 
new QBitmap CreateMaskFromColor (QColor maskColor, Qt.MaskMode mode)
  More...
 
new void Detach ()
  More...
 
new void Fill ()
  More...
 
new void Fill (QColor fillColor)
  More...
 
new void Fill (QWidget widget, QPoint ofs)
  More...
 
new void Fill (QWidget widget, int xofs, int yofs)
  More...
 
new bool Load (string fileName, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
new bool LoadFromData (QByteArray data, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
new bool LoadFromData (Pointer< byte > buf, uint len, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
new bool Save (QIODevice device, string format=null, int quality=-1)
  More...
 
new bool Save (string fileName, string format=null, int quality=-1)
  More...
 
new QPixmap Scaled (QSize s, Qt.AspectRatioMode aspectMode=Qt.AspectRatioMode.IgnoreAspectRatio, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
  More...
 
new QPixmap Scaled (int w, int h, Qt.AspectRatioMode aspectMode=Qt.AspectRatioMode.IgnoreAspectRatio, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
  More...
 
new QPixmap ScaledToHeight (int h, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
  More...
 
new QPixmap ScaledToWidth (int w, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
  More...
 
new void Scroll (int dx, int dy, QRect rect, QRegion exposed=null)
  More...
 
new void Scroll (int dx, int dy, int x, int y, int width, int height, QRegion exposed=null)
  More...
 
new void Swap (QPixmap other)
  More...
 
new QImage ToImage ()
  More...
 
new System.IntPtr ToWinHBITMAP (QPixmap.HBitmapFormat format=QPixmap.HBitmapFormat.NoAlpha)
  More...
 
new System.IntPtr ToWinHICON ()
  More...
 
new QPixmap Transformed (QMatrix matrix, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
  More...
 
new QPixmap Transformed (QTransform transform, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QPaintDevice
virtual System.IntPtr GetDC ()
 
virtual void ReleaseDC (System.IntPtr hdc)
 
new void Dispose ()
 

Static Public Member Functions

static QBitmap FromData (QSize size, Pointer< byte > bits, QImage.Format monoFormat=QImage.Format.Format_MonoLSB)
  More...
 
static QBitmap FromImage (QImage image, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
- Static Public Member Functions inherited from QtGui.QPixmap
static QPixmap FromImage (QImage image, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
static QPixmap FromImageReader (QImageReader imageReader, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
  More...
 
static QPixmap FromWinHBITMAP (System.IntPtr hbitmap, QPixmap.HBitmapFormat format=QPixmap.HBitmapFormat.NoAlpha)
  More...
 
static QPixmap FromWinHICON (System.IntPtr hicon)
  More...
 
static QPixmap GrabWidget (QWidget widget, QRect rect)
  More...
 
static QPixmap GrabWidget (QWidget widget, int x=0, int y=0, int w=-1, int h=-1)
  More...
 
static QPixmap GrabWindow (NativeULong window, int x=0, int y=0, int w=-1, int h=-1)
  More...
 
static bool operator! (QPixmap one)
  More...
 
static QMatrix TrueMatrix (QMatrix m, int w, int h)
  More...
 
static QTransform TrueMatrix (QTransform m, int w, int h)
  More...
 

Protected Member Functions

 QBitmap (System.Type dummy)
 
- Protected Member Functions inherited from QtGui.QPixmap
 QPixmap (System.Type dummy)
 
override int Metric (QPaintDevice.PaintDeviceMetric metric)
  More...
 
- Protected Member Functions inherited from QtGui.QPaintDevice
 QPaintDevice (System.Type dummy)
 
 QPaintDevice ()
  More...
 

Additional Inherited Members

- Public Types inherited from QtGui.QPixmap
enum  HBitmapFormat { Alpha = 2, NoAlpha = 0, PremultipliedAlpha = 1 }
  More...
 
enum  Type
 
- Protected Attributes inherited from QtGui.QPaintDevice
SmokeInvocation interceptor
 
- Properties inherited from QtGui.QPixmap
QPixmap AlphaChannel [get, set]
  More...
 
QBitmap Mask [get, set]
  More...
 
int Depth [get]
  More...
 
override int DevType [get]
 
int Height [get]
  More...
 
override QPaintEngine PaintEngine [get]
 
int Width [get]
  More...
 
long CacheKey [get]
  More...
 
static int DefaultDepth [get]
  More...
 
bool HasAlpha [get]
  More...
 
bool HasAlphaChannel [get]
  More...
 
bool IsDetached [get]
 
bool IsNull [get]
  More...
 
bool IsQBitmap [get]
  More...
 
QRect Rect [get]
  More...
 
int SerialNumber [get]
  More...
 
QSize Size [get]
  More...
 

Detailed Description

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

Constructor & Destructor Documentation

QtGui.QBitmap.QBitmap ( System.Type  dummy)
protected
QtGui.QBitmap.QBitmap ( )

Constructs a null bitmap.

See also QPixmap::isNull().

Here is the call graph for this function:

QtGui.QBitmap.QBitmap ( QPixmap  pixmap)

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().

Here is the call graph for this function:

QtGui.QBitmap.QBitmap ( QSize  size)

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

See also clear().

Here is the call graph for this function:

QtGui.QBitmap.QBitmap ( int  w,
int  h 
)

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

See also clear().

Here is the call graph for this function:

QtGui.QBitmap.QBitmap ( string  fileName,
string  format = null 
)

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.

See also QPixmap::isNull() and QImageReader::imageFormat().

Here is the call graph for this function:

Member Function Documentation

new void QtGui.QBitmap.Clear ( )

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

override void QtGui.QBitmap.CreateProxy ( )
virtual

Reimplemented from QtGui.QPaintDevice.

Here is the caller graph for this function:

new void QtGui.QBitmap.Dispose ( )
static QBitmap QtGui.QBitmap.FromData ( QSize  size,
Pointer< byte >  bits,
QImage.Format  monoFormat = QImage.Format.Format_MonoLSB 
)
static

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().

static QBitmap QtGui.QBitmap.FromImage ( QImage  image,
Qt.ImageConversionFlag  flags = Qt.ImageConversionFlag.AutoColor 
)
static

Returns a copy of the given image converted to a bitmap using the specified image conversion flags.

See also fromData().

new void QtGui.QBitmap.Swap ( QBitmap  other)

Swaps bitmap other with this bitmap. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

new QBitmap QtGui.QBitmap.Transformed ( QMatrix  matrix)

This is an overloaded function.

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

new QBitmap QtGui.QBitmap.Transformed ( QTransform  matrix)

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

See also QPixmap::transformed().