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

The QPaintDevice class is the base class of objects that can be painted. More...

Inheritance diagram for QtGui.QPaintDevice:
Collaboration diagram for QtGui.QPaintDevice:

Public Types

enum  PaintDeviceMetric {
  PdmDepth = 6, PdmDpiX = 7, PdmDpiY = 8, PdmHeight = 2,
  PdmHeightMM = 4, PdmNumColors = 5, PdmPhysicalDpiX = 9, PdmPhysicalDpiY = 10,
  PdmWidth = 1, PdmWidthMM = 3
}
  More...
 

Public Member Functions

virtual void CreateProxy ()
 
virtual System.IntPtr GetDC ()
 
virtual void ReleaseDC (System.IntPtr hdc)
 
new void Dispose ()
 

Protected Member Functions

 QPaintDevice (System.Type dummy)
 
 QPaintDevice ()
  More...
 
virtual int Metric (QPaintDevice.PaintDeviceMetric metric)
  More...
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

int ColorCount [get]
  More...
 
int Depth [get]
  More...
 
virtual int DevType [get]
 
int Height [get]
  More...
 
int HeightMM [get]
  More...
 
int LogicalDpiX [get]
  More...
 
int LogicalDpiY [get]
  More...
 
int NumColors [get]
  More...
 
virtual QPaintEngine PaintEngine [get]
  More...
 
bool PaintingActive [get]
  More...
 
int PhysicalDpiX [get]
  More...
 
int PhysicalDpiY [get]
  More...
 
int Width [get]
  More...
 
int WidthMM [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new ushort Painters [get, set]
 
- Properties inherited from QtGui.IQPaintDevice
System.Int32 ColorCount [get]
  More...
 
System.Int32 Depth [get]
  More...
 
System.Int32 DevType [get]
 
System.Int32 Height [get]
  More...
 
System.Int32 HeightMM [get]
  More...
 
System.Int32 LogicalDpiX [get]
  More...
 
System.Int32 LogicalDpiY [get]
  More...
 
System.Int32 NumColors [get]
  More...
 
QPaintEngine PaintEngine [get]
  More...
 
System.Boolean PaintingActive [get]
  More...
 
System.Int32 PhysicalDpiX [get]
  More...
 
System.Int32 PhysicalDpiY [get]
  More...
 
System.Int32 Width [get]
  More...
 
System.Int32 WidthMM [get]
  More...
 

Detailed Description

The QPaintDevice class is the base class of objects that can be painted.

A paint device is an abstraction of a two-dimensional space that can be drawn using a QPainter. Its default coordinate system has its origin located at the top-left position. X increases to the right and Y increases downwards. The unit is one pixel.

The drawing capabilities of QPaintDevice are currently implemented by the QWidget, QImage, QPixmap, QGLPixelBuffer, QPicture, and QPrinter subclasses.

To implement support for a new backend, you must derive from QPaintDevice and reimplement the virtual paintEngine() function to tell QPainter which paint engine should be used to draw on this particular device. Note that you also must create a corresponding paint engine to be able to draw on the device, i.e derive from QPaintEngine and reimplement its virtual functions.

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.

The QPaintDevice class provides several functions returning the various device metrics: The depth() function returns its bit depth (number of bit planes). The height() function returns its height in default coordinate system units (e.g. pixels for QPixmap and QWidget) while heightMM() returns the height of the device in millimeters. Similiarily, the width() and widthMM() functions return the width of the device in default coordinate system units and in millimeters, respectively. Alternatively, the protected metric() function can be used to retrieve the metric information by specifying the desired PaintDeviceMetric as argument.

The logicalDpiX() and logicalDpiY() functions return the horizontal and vertical resolution of the device in dots per inch. The physicalDpiX() and physicalDpiY() functions also return the resolution of the device in dots per inch, but note that if the logical and physical resolution differ, the corresponding QPaintEngine must handle the mapping. Finally, the colorCount() function returns the number of different colors available for the paint device.

See also QPaintEngine, QPainter, Coordinate System, and Paint System.

Member Enumeration Documentation

Describes the various metrics of a paint device.

See also metric().

Enumerator
PdmDepth 

The bit depth (number of bit planes) of the paint device. See also depth().

PdmDpiX 

The horizontal resolution of the device in dots per inch. See also logicalDpiX().

PdmDpiY 

The vertical resolution of the device in dots per inch. See also logicalDpiY().

PdmHeight 

The height of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget). See also height().

PdmHeightMM 

The height of the paint device in millimeters. See also heightMM().

PdmNumColors 

The number of different colors available for the paint device. See also colorCount().

PdmPhysicalDpiX 

The horizontal resolution of the device in dots per inch. See also physicalDpiX().

PdmPhysicalDpiY 

The vertical resolution of the device in dots per inch. See also physicalDpiY().

PdmWidth 

The width of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget). See also width().

PdmWidthMM 

The width of the paint device in millimeters. See also widthMM().

Constructor & Destructor Documentation

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

Constructs a paint device. This constructor can be invoked only from subclasses of QPaintDevice.

Here is the call graph for this function:

Member Function Documentation

virtual void QtGui.QPaintDevice.CreateProxy ( )
virtual
new void QtGui.QPaintDevice.Dispose ( )
virtual System.IntPtr QtGui.QPaintDevice.GetDC ( )
virtual

Implements QtGui.IQPaintDevice.

Reimplemented in QtGui.QPrinter.

virtual int QtGui.QPaintDevice.Metric ( QPaintDevice.PaintDeviceMetric  metric)
protectedvirtual

Returns the metric information for the given paint device metric.

See also PaintDeviceMetric.

Reimplemented in QtGui.QPrinter, QtGui.QPixmap, QtGui.QPicture, QtGui.QImage, QtOpenGL.QGLPixelBuffer, QtSvg.QSvgGenerator, and QtOpenGL.QGLFramebufferObject.

virtual void QtGui.QPaintDevice.ReleaseDC ( System.IntPtr  hdc)
virtual

Implements QtGui.IQPaintDevice.

Reimplemented in QtGui.QPrinter.

Member Data Documentation

SmokeInvocation QtGui.QPaintDevice.interceptor
protected

Property Documentation

int QtGui.QPaintDevice.ColorCount
get

Returns the number of different colors available for the paint device. Since this value is an int, it will not be sufficient to represent the number of colors on 32 bit displays, in this case INT_MAX is returned instead.

int QtGui.QPaintDevice.Depth
get

Returns the bit depth (number of bit planes) of the paint device.

virtual int QtGui.QPaintDevice.DevType
get
int QtGui.QPaintDevice.Height
get

Returns the height of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

See also heightMM().

int QtGui.QPaintDevice.HeightMM
get

Returns the height of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also height().

int QtGui.QPaintDevice.LogicalDpiX
get

Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from widthMM().

Note that if the logicalDpiX() doesn't equal the physicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also logicalDpiY() and physicalDpiX().

int QtGui.QPaintDevice.LogicalDpiY
get

Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from heightMM().

Note that if the logicalDpiY() doesn't equal the physicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also logicalDpiX() and physicalDpiY().

int QtGui.QPaintDevice.NumColors
get

This function is deprecated.

Use colorCount() instead.

Returns the number of different colors available for the paint device. Since this value is an int, it will not be sufficient to represent the number of colors on 32 bit displays, in this case INT_MAX is returned instead.

virtual QPaintEngine QtGui.QPaintDevice.PaintEngine
get

Returns a pointer to the paint engine used for drawing on the device.

new ushort QtGui.QPaintDevice.Painters
getsetprotected
bool QtGui.QPaintDevice.PaintingActive
get

Returns true if the device is currently being painted on, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns false.

See also QPainter::isActive().

int QtGui.QPaintDevice.PhysicalDpiX
get

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiX() doesn't equal the logicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also physicalDpiY() and logicalDpiX().

int QtGui.QPaintDevice.PhysicalDpiY
get

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiY() doesn't equal the logicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also physicalDpiX() and logicalDpiY().

virtual System.IntPtr QtGui.QPaintDevice.SmokeObject
getset
int QtGui.QPaintDevice.Width
get

Returns the width of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

See also widthMM().

int QtGui.QPaintDevice.WidthMM
get

Returns the width of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also width().