本页内容

imagepattern2d QML Value Type

提供与 `QCanvasImagePattern` 匹配的 `imagepattern2d` 类型。更多内容...

Import Statement: import QtCanvas2D
Since: Qt 6.12
Status: Technology preview

此类型处于技术预览阶段,可能会有变动。

方法

详细说明

此值类型由QtCanvas2D 导入提供。

另请参阅 QCanvasImagePattern 。

方法文档

size imageSize()

返回 pattern 中单张图片的大小。

另请参阅 setImageSize()。

real rotation()

返回图案的旋转角度(单位为弧度)。

另请参阅 setRotation()。

void setImageSize(real width, real height)

将模式中单张图片的大小设置为 (width,height)。

另请参阅 imageSize()。

void setImageSize(size imageSize)

将模式中单张图片的大小设置为imageSize 。

这是一个重载函数。

void setRotation(real rotation)

将图案旋转角度设置为rotation (单位为弧度)。旋转以图像startPosition()为中心进行。默认值为0.0 ,表示不旋转图像。

另请参阅 rotation()。

void setStartPosition(real x, real y)

将图像图案的起始点设置为 (x,y)。起始位置指图案中图像的左上角。随后,图案将从该位置向所有方向延伸(如果已设置图像Repeat 标志)。

另请参阅 startPosition()。

void setStartPosition(point start)

将图像图案的起始点设置为start 。起始位置指图案中图像的左上角。随后,图案将从该位置向所有方向延伸(如果已设置图像Repeat 标志)。

这是一个重载函数。

void setTintColor(color tintColor)

将图案的色调颜色设置为tintColor 。在着色器中,图案图像的颜色将与该色调颜色进行乘法运算。默认值为白色,表示不进行色调调整。

注意:若要 全局设置透明度,请使用QCanvasPainter::setGlobalAlpha()

另请参阅 tintColor()。

point startPosition()

返回图像图案的起始点。

另请参阅 setStartPosition()。

color tintColor()

返回图案的色调颜色。

另请参阅 setTintColor()。

© 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.