QPainter::PixmapFragment Class
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) |
详细说明
sourceLeft,sourceTop,width 和height 变量用作传入QPainter::drawPixmapFragments() 函数的像素图中的源矩形。x,y,width 和height 变量用于计算绘制的目标矩形。x 和y 表示目标矩形的中心点。目标矩形中的width 和height 按scaleX 和scaleY 的值缩放。然后,生成的目标矩形将围绕x,y 中心点旋转rotation 度。
另请参阅 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
该变量保存源矩形的高度,用于计算目标矩形的高度。
qreal PixmapFragment::opacity
该变量表示目标矩形的不透明度,0.0 表示完全透明,1.0 表示完全不透明。
qreal PixmapFragment::rotation
此变量用于保存目标矩形的旋转角度。目标矩形会在缩放后旋转。
qreal PixmapFragment::scaleX
该变量用于保存目标矩形的水平比例。
qreal PixmapFragment::scaleY
该变量用于保存目标矩形的垂直比例。
qreal PixmapFragment::sourceLeft
该变量保存源矩形的左坐标。
qreal PixmapFragment::sourceTop
此变量保存源矩形的顶坐标。
qreal PixmapFragment::width
该变量保存源矩形的宽度,用于计算目标矩形的宽度。
qreal PixmapFragment::x
此变量保存目标矩形中心点的 x 坐标。
qreal PixmapFragment::y
此变量保存目标矩形中心点的 Y 坐标。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.