On this page

imagepattern2d QML Value Type

Provides imagepattern2d type matching to QCanvasImagePattern. More...

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

This type is in technology preview and is subject to change.

Methods

Detailed Description

This value type is provided by the QtCanvas2D import.

See also QCanvasImagePattern.

Method Documentation

size imageSize()

Returns the size of a single image in pattern.

See also setImageSize().

real rotation()

Returns the pattern rotation in radians.

See also setRotation().

void setImageSize(real width, real height)

Sets the size of a single image in pattern to ( width, height).

See also imageSize().

void setImageSize(size imageSize)

Sets the size of a single image in pattern to imageSize.

This is an overloaded function.

void setRotation(real rotation)

Sets the pattern rotation to rotation in radians. Rotation is done around the image startPosition(). The default value is 0.0, meaning the image is not rotated.

See also rotation().

void setStartPosition(real x, real y)

Sets the start point of image pattern to (x, y). Start position means top-left corner of an image in pattern. Pattern will then be extended to all positions from here (if image Repeat flag has been set).

See also startPosition().

void setStartPosition(point start)

Sets the start point of image pattern to start. Start position means top-left corner of an image in pattern. Pattern will then be extended to all positions from here (if image Repeat flag has been set).

This is an overloaded function.

void setTintColor(color tintColor)

Sets the pattern tint color to tintColor. The color of the pattern image will be multiplied with this tint color in the shader. The default value is white, meaning no tinting.

Note: To set alpha globally, use QCanvasPainter::setGlobalAlpha()

See also tintColor().

point startPosition()

Returns the start point of image pattern.

See also setStartPosition().

color tintColor()

Returns the pattern tint color.

See also 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.