Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QPaintDevice class is the base class of objects that can be painted. More...
#include <qpaintdevice.h>
Inherited by QPixmap, QWidget, QPicture and QPrinter.
A paint device is an abstraction of a two-dimensional space that can be drawn using a QPainter. The drawing capabilities are implemented by the subclasses QWidget, QPixmap, QPicture and QPrinter.
The default coordinate system of a paint device has its origin located at the top-left position. X increases to the right and Y increases downward. The unit is one pixel. There are several ways to set up a user-defined coordinate system using the painter, for example, using QPainter::setWorldMatrix().
Example (draw on a paint device):
void MyWidget::paintEvent( QPaintEvent * ) { QPainter p; // our painter p.begin( this ); // start painting the widget p.setPen( red ); // red outline p.setBrush( yellow ); // yellow fill p.drawEllipse( 10, 20, 100,100 ); // 100x100 ellipse at position (10, 20) p.end(); // painting done }
The bit block transfer is an extremely useful operation for copying pixels from one paint device to another (or to itself). It is implemented as the global function bitBlt().
Example (scroll widget contents 10 pixels to the right):
bitBlt( myWidget, 10, 0, myWidget );
Warning: Qt requires that a QApplication object exists before any paint devices can be created. Paint devices access window system resources, and these resources are not initialized before an application object is created.
See also Graphics Classes and Image Processing Classes.
Implemented by subclasses that have no direct support for drawing graphics (external paint devices, for example, QPicture).
The HANDLE type varies with platform; see qpaintdevice.h and qwindowdefs.h for details.
See also x11Display().
Returns TRUE if the device is an external paint device; otherwise returns FALSE.
External paint devices cannot be bitBlt()'ed from. QPicture and QPrinter are external paint devices.
Returns TRUE if the device is being painted, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns FALSE.
See also QPainter::isActive().
Returns the number of entries in the colormap of the X display global to the application (X11 only). Using this function is not portable.
See also x11Colormap().
Returns the colormap of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default Visual of the X display global to the application (X11 only). Using this function is not portable.
Returns the depth of the X display global to the application (X11 only). Using this function is not portable.
See also QPixmap::defaultDepth().
Returns a pointer to the X display global to the application (X11 only). Using this function is not portable.
See also handle().
See also x11AppDpiY(), x11SetAppDpiX() and QPaintDeviceMetrics::logicalDpiX().
See also x11AppDpiX(), x11SetAppDpiY() and QPaintDeviceMetrics::logicalDpiY().
Returns the screen number on the X display global to the application (X11 only). Using this function is not portable.
Returns the Visual of the X display global to the application (X11 only). Using this function is not portable.
Returns the number of entries in the colormap of the X display for the paint device (X11 only). Using this function is not portable.
See also x11Colormap().
Returns the colormap of the X display for the paint device (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap of the X display for the paint device (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default Visual of the X display for the paint device (X11 only). Using this function is not portable.
Returns the depth of the X display for the paint device (X11 only). Using this function is not portable.
See also QPixmap::defaultDepth().
Returns a pointer to the X display for the paint device (X11 only). Using this function is not portable.
See also handle().
Returns the screen number on the X display for the paint device (X11 only). Using this function is not portable.
See also x11SetAppDpiY().
See also x11SetAppDpiX().
Returns the Visual of the X display for the paint device (X11 only). Using this function is not portable.
Copies a block of pixels from src to dst, perhaps merging each pixel according to the raster operation rop. sx, sy is the top-left pixel in src (0, 0) by default, dx, dy is the top-left position in dst and sw, sh is the size of the copied block (all of src by default).
The most common values for rop are CopyROP and XorROP; the Qt::RasterOp documentation defines all the possible values.
If ignoreMask is TRUE (the default is FALSE) and src is a masked QPixmap, the entire blit is masked by src->mask().
If src, dst, sw or sh is 0, bitBlt() does nothing. If sw or sh is negative bitBlt() copies starting at sx (and respectively, sy) and ending at the right end (respectively, bottom) of src.
src must be a QWidget or QPixmap. You cannot blit from a QPrinter, for example. bitBlt() does nothing if you attempt to blit from an unsupported device.
bitBlt() does nothing if src has a greater depth than dst. If you need to for example, draw a 24-bit pixmap on an 8-bit widget, you must use drawPixmap().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Overloaded bitBlt() with the destination point dp and source rectangle sr.
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.4
|