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 坐标。
© 2026 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.