PixmapFragment 类

class QPainter ::PixmapFragment

此类用于结合 QPainter::drawPixmapFragments () 函数以指定如何绘制像素图 (或像素图子矩形)。 更多...

公共变量

qreal height
qreal opacity
qreal rotation
qreal scaleX
qreal scaleY
qreal sourceLeft
qreal sourceTop
qreal width
qreal x
qreal y

静态公共成员

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

详细描述

The sourceLeft , sourceTop , width and height 用作像素图源矩形的变量,会被传入 QPainter::drawPixmapFragments () 函数。变量 x , y , width and height 用于计算绘制的目标矩形。 x and y 表示目标矩形的中心。 width and height 是比例缩放目标矩形的 scaleX and scaleY 值。那么,结果目标矩形会旋转 rotation 度围绕 x , y 中心点。

另请参阅 QPainter::drawPixmapFragments ().

成员函数文档编制

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

此方便函数返回 QPainter::PixmapFragment 的初始化是采用 pos , sourceRect , scaleX , scaleY , rotation , opacity 参数。

成员变量文档编制

qreal PixmapFragment:: height

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

qreal PixmapFragment:: opacity

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

qreal PixmapFragment:: rotation

This variable holds the rotation of the target rectangle in degrees. The target rectangle is rotated after it has been scaled.

qreal PixmapFragment:: scaleX

This variable holds the horizontal scale of the target rectangle.

qreal PixmapFragment:: scaleY

This variable holds the vertical scale of the target rectangle.

qreal PixmapFragment:: sourceLeft

This variable holds the left coordinate of the source rectangle.

qreal PixmapFragment:: sourceTop

This variable holds the top coordinate of the source rectangle.

qreal PixmapFragment:: width

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

qreal PixmapFragment:: x

This variable holds the x coordinate of center point in the target rectangle.

qreal PixmapFragment:: y

This variable holds the y coordinate of the center point in the target rectangle.