.BI "void \fBbitBlt\fR ( QPaintDevice * dst, int dx, int dy, const QPaintDevice * src, int sx, int sy, int sw, int sh, TQt::RasterOp rop, bool ignoreMask )"
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 TQWidget, 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().
.PP
Example (draw on a paint device):
.PP
.nf
.br
void MyWidget::paintEvent( QPaintEvent * )
.br
{
.br
QPainter p; // our painter
.br
p.begin( this ); // start painting the widget
.br
p.setPen( red ); // red outline
.br
p.setBrush( yellow ); // yellow fill
.br
p.drawEllipse( 10, 20, 100,100 ); // 100x100 ellipse at position (10, 20)
.br
p.end(); // painting done
.br
}
.br
.fi
.PP
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().
.PP
Example (scroll widget contents 10 pixels to the right):
\fBWarning:\fR TQt 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.
Returns TRUE if the device is an external paint device; otherwise returns FALSE.
.PP
External paint devices cannot be bitBlt()'ed from. QPicture and QPrinter are external paint devices.
.SH "bool QPaintDevice::paintingActive () const"
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.
Returns the number of entries in the colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Colormap().
.SH "int QPaintDevice::x11AppCells ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the number of entries in the colormap for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
Returns TRUE if the Visual used is the default for the default screen of the X display global to the application (X11 only); otherwise returns FALSE. Using this function is not portable.
.SH "bool QPaintDevice::x11AppDefaultVisual ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the Visual used is the default for screen \fIscreen\fR of the X display global to the application (X11 only); otherwise returns FALSE. Using this function is not portable.
.SH "int QPaintDevice::x11AppDepth ( int screen )\fC [static]\fR"
Returns the depth for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
Returns a pointer to the X display global to the application (X11 only). Using this function is not portable.
.PP
See also handle().
.SH "int QPaintDevice::x11AppDpiX ( int screen )\fC [static]\fR"
Returns the horizontal DPI of the X display (X11 only) for screen \fIscreen\fR. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.PP
See also x11AppDpiY(), x11SetAppDpiX(), and QPaintDeviceMetrics::logicalDpiX().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the horizontal DPI of the X display (X11 only) for the default screen. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.SH "int QPaintDevice::x11AppDpiY ( int screen )\fC [static]\fR"
Returns the vertical DPI of the X11 display (X11 only) for screen \fIscreen\fR. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.PP
See also x11AppDpiX(), x11SetAppDpiY(), and QPaintDeviceMetrics::logicalDpiY().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the vertical DPI of the X11 display (X11 only) for the default screen. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.PP
See also x11AppDpiX(), x11SetAppDpiY(), and QPaintDeviceMetrics::logicalDpiY().
Returns the default Visual of the X display for the paint device (X11 only). Using this function is not portable.
.SH "int QPaintDevice::x11Depth () const"
Returns the depth of the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also QPixmap::defaultDepth().
.SH "Display * QPaintDevice::x11Display () const"
Returns a pointer to the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also handle().
.SH "int QPaintDevice::x11Screen () const"
Returns the screen number on the X display for the paint device (X11 only). Using this function is not portable.
.SH "void QPaintDevice::x11SetAppDpiX ( int dpi, int screen )\fC [static]\fR"
Sets the value returned by x11AppDpiX() to \fIdpi\fR for screen \fIscreen\fR. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.PP
See also x11SetAppDpiY().
.SH "void QPaintDevice::x11SetAppDpiX ( int dpi )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the value returned by x11AppDpiX() to \fIdpi\fR for the default screen. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.SH "void QPaintDevice::x11SetAppDpiY ( int dpi, int screen )\fC [static]\fR"
Sets the value returned by x11AppDpiY() to \fIdpi\fR for screen \fIscreen\fR. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.PP
See also x11SetAppDpiX().
.SH "void QPaintDevice::x11SetAppDpiY ( int dpi )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the value returned by x11AppDpiY() to \fIdpi\fR for the default screen. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.SH "void * QPaintDevice::x11Visual () const"
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 \fIsrc\fR to \fIdst\fR, perhaps merging each pixel according to the raster operation \fIrop\fR. \fIsx\fR, \fIsy\fR is the top-left pixel in \fIsrc\fR (0, 0) by default, \fIdx\fR, \fIdy\fR is the top-left position in \fIdst\fR and \fIsw\fR, \fIsh\fR is the size of the copied block (all of \fIsrc\fR by default).
If \fIignoreMask\fR is FALSE (the default) and \fIsrc\fR is a masked QPixmap, the entire blit is masked by \fIsrc\fR->mask().
.PP
If \fIsrc\fR, \fIdst\fR, \fIsw\fR or \fIsh\fR is 0, bitBlt() does nothing. If \fIsw\fR or \fIsh\fR is negative bitBlt() copies starting at \fIsx\fR (and respectively, \fIsy\fR) and ending at the right end (respectively, bottom) of \fIsrc\fR.
\fIsrc\fR must be a TQWidget 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 \fIsrc\fR has a greater depth than \fIdst\fR. If you need to for example, draw a 24-bit pixmap on an 8-bit widget, you must use drawPixmap().