Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The TQPaintDevice class is the base class of objects that can be painted. More...
#include <ntqpaintdevice.h>
Inherited by TQWidget, TQPixmap, TQPicture, and TQPrinter.
A paint device is an abstraction of a two-dimensional space that can be drawn using a TQPainter. The drawing capabilities are implemented by the subclasses TQWidget, TQPixmap, TQPicture and TQPrinter.
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 TQPainter::setWorldMatrix().
Example (draw on a paint device):
void MyWidget::paintEvent( TQPaintEvent * ) { TQPainter 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: TQt requires that a TQApplication 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, TQPicture).
The HANDLE type varies with platform; see ntqpaintdevice.h and ntqwindowdefs.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. TQPicture and TQPrinter are external paint devices.
Returns TRUE if the device is being painted, i.e. someone has called TQPainter::begin() but not yet called TQPainter::end() for this device; otherwise returns FALSE.
See also TQPainter::isActive().
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.
See also x11Colormap().
Returns the number of entries in the colormap for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Colormap().
Returns the colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the colormap for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
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.
Returns TRUE if the Visual used is the default for screen screen of the X display global to the application (X11 only); otherwise returns FALSE. Using this function is not portable.
Returns the depth for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also TQPixmap::defaultDepth().
Returns the depth for the default screen of the X display global to the application (X11 only). Using this function is not portable.
See also TQPixmap::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 TQPaintDeviceMetrics::logicalDpiX().
Returns the horizontal DPI of the X display (X11 only) for the default screen. Using this function is not portable. See TQPaintDeviceMetrics for portable access to related information. Using this function is not portable.
See also x11AppDpiX(), x11SetAppDpiY(), and TQPaintDeviceMetrics::logicalDpiY().
Returns the vertical DPI of the X11 display (X11 only) for the default screen. Using this function is not portable. See TQPaintDeviceMetrics for portable access to related information. Using this function is not portable.
See also x11AppDpiX(), x11SetAppDpiY(), and TQPaintDeviceMetrics::logicalDpiY().
Returns the root window for the default screen of the X display global to the applicatoin (X11 only). Using this function is not portable.
Returns the root window for screen screen of the X display global to the applicatoin (X11 only). Using this function is not portable.
Returns the screen number on the X display global to the application (X11 only). Using this function is not portable.
Returns the Visual for the default screen of the X display global to the application (X11 only). Using this function is not portable.
Returns the Visual for screen screen 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 TQPixmap::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().
Sets the value returned by x11AppDpiX() to dpi 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.
See also x11SetAppDpiX().
Sets the value returned by x11AppDpiY() to dpi 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.
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 TQt::RasterOp documentation defines all the possible values.
If ignoreMask is FALSE (the default) and src is a masked TQPixmap, 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 TQWidget or TQPixmap. You cannot blit from a TQPrinter, 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 TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.
Copyright © 2007 Trolltech | Trademarks | TQt 3.3.8
|