Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations 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 ()
 
 
 QBitmap (QPixmap arg1)
 
 
 QBitmap (QSize arg1)
 
 
 QBitmap (int w, int h)
 
 
 QBitmap (string fileName, string format=null)
 
 
override void CreateProxy ()
 
new void Clear ()
 
 
new void Swap (QBitmap other)
 
 
new QBitmap Transformed (QMatrix arg1)
 
 
new QBitmap Transformed (QTransform matrix)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QPixmap
 QPixmap ()
 
 
 QPixmap (QSize arg1)
 
 
 QPixmap (QPixmap arg1)
 
 
 QPixmap (int w, int h)
 
 
 QPixmap (string fileName, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
 
 
override void CreateProxy ()
 
new long CacheKey ()
 
 
new bool ConvertFromImage (QImage img, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
 
 
new QPixmap Copy ()
 
 
new QPixmap Copy (QRect rect)
 
 
new QPixmap Copy (int x, int y, int width, int height)
 
 
new QBitmap CreateHeuristicMask (bool clipTight=true)
 
 
new QBitmap CreateMaskFromColor (QColor maskColor)
 
 
new QBitmap CreateMaskFromColor (QColor maskColor, Qt.MaskMode mode)
 
 
new int Depth ()
 
 
new void Detach ()
 
 
override int DevType ()
 
new void Fill ()
 
 
new void Fill (QColor fillColor)
 
 
new void Fill (QWidget widget, QPoint ofs)
 
 
new void Fill (QWidget widget, int xofs, int yofs)
 
 
new bool HasAlpha ()
 
 
new bool HasAlphaChannel ()
 
 
new int Height ()
 
 
new bool IsDetached ()
 
new bool IsNull ()
 
 
new bool IsQBitmap ()
 
 
new bool Load (string fileName, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
 
 
new bool LoadFromData (QByteArray data, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
 
 
new bool LoadFromData (Pointer< byte > buf, uint len, string format=null, Qt.ImageConversionFlag flags=Qt.ImageConversionFlag.AutoColor)
 
 
override QPaintEngine PaintEngine ()
 
 
new QRect Rect ()
 
 
new bool Save (QIODevice device, string format=null, int quality=-1)
 
 
new bool Save (string fileName, string format=null, int quality=-1)
 
 
new QPixmap Scaled (QSize s, Qt.AspectRatioMode aspectMode=Qt.AspectRatioMode.IgnoreAspectRatio, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
 
 
new QPixmap Scaled (int w, int h, Qt.AspectRatioMode aspectMode=Qt.AspectRatioMode.IgnoreAspectRatio, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
 
 
new QPixmap ScaledToHeight (int h, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
 
 
new QPixmap ScaledToWidth (int w, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
 
 
new void Scroll (int dx, int dy, QRect rect, QRegion exposed=null)
 
 
new void Scroll (int dx, int dy, int x, int y, int width, int height, QRegion exposed=null)
 
 
new int SerialNumber ()
 
new QSize Size ()
 
 
new void Swap (QPixmap other)
 
 
new QImage ToImage ()
 
 
new System.IntPtr ToWinHBITMAP (QPixmap.HBitmapFormat format=QPixmap.HBitmapFormat.NoAlpha)
 
 
new System.IntPtr ToWinHICON ()
 
 
new QPixmap Transformed (QMatrix arg1, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
 
 
new QPixmap Transformed (QTransform arg1, Qt.TransformationMode mode=Qt.TransformationMode.FastTransformation)
 
 
new int Width ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QPaintDevice
new int ColorCount ()
 
 
new int Depth ()
 
 
virtual System.IntPtr GetDC ()
 
new int Height ()
 
 
new int HeightMM ()
 
 
new int LogicalDpiX ()
 
 
new int LogicalDpiY ()
 
 
new int NumColors ()
 
 
new bool PaintingActive ()
 
 
new int PhysicalDpiX ()
 
 
new int PhysicalDpiY ()
 
 
virtual void ReleaseDC (System.IntPtr hdc)
 
new int Width ()
 
 
new int WidthMM ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.IQPaintDevice
new int ColorCount ()
 
new int Depth ()
 
int DevType ()
 
System.IntPtr GetDC ()
 
new int Height ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
QPaintEngine PaintEngine ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
void ReleaseDC (System.IntPtr hdc)
 
new int Width ()
 
new int WidthMM ()
 

Static Public Member Functions

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

Protected Member Functions

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

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
new QPixmap AlphaChannel [get, set]
 
new QBitmap Mask [get, set]
 
 

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

QtGui.QBitmap.QBitmap ( QPixmap  arg1)

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

QtGui.QBitmap.QBitmap ( QSize  arg1)

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

See also clear().

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

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

See also clear().

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

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.

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  arg1)

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

See also QPixmap::transformed().

new QBitmap QtGui.QBitmap.Transformed ( QTransform  matrix)

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

See also QPixmap::transformed().