Qt 4.8
Static Public Functions | Public Variables | List of all members
QPainter::PixmapFragment Class Reference

This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a pixmap, or sub-rect of a pixmap, is drawn. More...

#include <qpainter.h>

Static Public Functions

static PixmapFragment Q_GUI_EXPORT create (const QPointF &pos, const QRectF &sourceRect, qreal scaleX=1, qreal scaleY=1, qreal rotation=0, qreal opacity=1)
 This is a convenience function that returns a QPainter::PixmapFragment that is initialized with the pos, sourceRect, scaleX, scaleY, rotation, opacity parameters. More...
 

Public Variables

qreal height
 the height of the source rectangle and is used to calculate the height of the target rectangle. More...
 
qreal opacity
 the opacity of the target rectangle, where 0.0 is fully transparent and 1.0 is fully opaque. More...
 
qreal rotation
 the rotation of the target rectangle in degrees. More...
 
qreal scaleX
 the horizontal scale of the target rectangle. More...
 
qreal scaleY
 the vertical scale of the target rectangle. More...
 
qreal sourceLeft
 the left coordinate of the source rectangle. More...
 
qreal sourceTop
 the top coordinate of the source rectangle. More...
 
qreal width
 the width of the source rectangle and is used to calculate the width of the target rectangle. More...
 
qreal x
 the x coordinate of center point in the target rectangle. More...
 
qreal y
 the y coordinate of the center point in the target rectangle. More...
 

Detailed Description

This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a pixmap, or sub-rect of a pixmap, is drawn.

Since
4.7

The sourceLeft, sourceTop, width and height variables are used as a source rectangle within the pixmap passed into the QPainter::drawPixmapFragments() function. The variables x, y, width and height are used to calculate the target rectangle that is drawn. x and y denotes the center of the target rectangle. The width and height in the target rectangle is scaled by the scaleX and scaleY values. The resulting target rectangle is then rotated rotation degrees around the x, y center point.

See also
QPainter::drawPixmapFragments()

Definition at line 103 of file qpainter.h.

Functions

◆ create()

QPainter::PixmapFragment QPainter::PixmapFragment::create ( const QPointF pos,
const QRectF sourceRect,
qreal  scaleX = 1,
qreal  scaleY = 1,
qreal  rotation = 0,
qreal  opacity = 1 
)
static

This is a convenience function that returns a QPainter::PixmapFragment that is initialized with the pos, sourceRect, scaleX, scaleY, rotation, opacity parameters.

Since
4.7

Definition at line 9829 of file qpainter.cpp.

9832 {
9833  PixmapFragment fragment = {pos.x(), pos.y(), sourceRect.x(), sourceRect.y(), sourceRect.width(),
9834  sourceRect.height(), scaleX, scaleY, rotation, opacity};
9835  return fragment;
9836 }
qreal scaleY
the vertical scale of the target rectangle.
Definition: qpainter.h:112
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
qreal opacity
the opacity of the target rectangle, where 0.0 is fully transparent and 1.0 is fully opaque...
Definition: qpainter.h:114
qreal rotation
the rotation of the target rectangle in degrees.
Definition: qpainter.h:113
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
qreal scaleX
the horizontal scale of the target rectangle.
Definition: qpainter.h:111
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287

Properties

◆ height

QPainter::PixmapFragment::height

the height of the source rectangle and is used to calculate the height of the target rectangle.

Definition at line 110 of file qpainter.h.

Referenced by QEmulationPaintEngine::drawPixmapFragments(), QPaintEngineEx::drawPixmapFragments(), QGL2PaintEngineExPrivate::drawPixmapFragments(), and QPainter::drawPixmapFragments().

◆ opacity

QPainter::PixmapFragment::opacity

the opacity of the target rectangle, where 0.0 is fully transparent and 1.0 is fully opaque.

Definition at line 114 of file qpainter.h.

Referenced by QEmulationPaintEngine::drawPixmapFragments(), QVGPaintEngine::drawPixmapFragments(), QPaintEngineEx::drawPixmapFragments(), and QGL2PaintEngineExPrivate::drawPixmapFragments().

◆ rotation

QPainter::PixmapFragment::rotation

the rotation of the target rectangle in degrees.

The target rectangle is rotated after it has been scaled.

Definition at line 113 of file qpainter.h.

◆ scaleX

QPainter::PixmapFragment::scaleX

◆ scaleY

QPainter::PixmapFragment::scaleY

◆ sourceLeft

QPainter::PixmapFragment::sourceLeft

the left coordinate of the source rectangle.

Definition at line 107 of file qpainter.h.

◆ sourceTop

QPainter::PixmapFragment::sourceTop

the top coordinate of the source rectangle.

Definition at line 108 of file qpainter.h.

◆ width

QPainter::PixmapFragment::width

the width of the source rectangle and is used to calculate the width of the target rectangle.

Definition at line 109 of file qpainter.h.

Referenced by QEmulationPaintEngine::drawPixmapFragments(), QPaintEngineEx::drawPixmapFragments(), QGL2PaintEngineExPrivate::drawPixmapFragments(), and QPainter::drawPixmapFragments().

◆ x

QPainter::PixmapFragment::x

the x coordinate of center point in the target rectangle.

Definition at line 105 of file qpainter.h.

Referenced by QGL2PaintEngineExPrivate::drawPixmapFragments(), and QPainter::drawPixmapFragments().

◆ y

QPainter::PixmapFragment::y

the y coordinate of the center point in the target rectangle.

Definition at line 106 of file qpainter.h.

Referenced by QGL2PaintEngineExPrivate::drawPixmapFragments(), and QPainter::drawPixmapFragments().


The documentation for this class was generated from the following files: