이 페이지에서

lineargradient2d QML Value Type

QCanvasLinearGradient 에 대한 lineargradient2d 유형 매칭을 제공합니다. 더 보기...

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

이 유형은 기술 미리보기 단계에 있으며 변경될 수 있습니다.

메서드

상세 설명

이 값 유형은 ` QtCanvas2D ` 임포트에서 제공됩니다.

QCanvasLinearGradient도 참조하십시오 .

메서드 설명

void addColorStop(real offset, string color)

지정된 color 를 가진 컬러 스톱을, 지정된 offset 위치의 그라데이션에 추가합니다. 0.0은 그라데이션 한쪽 끝의 오프셋을, 1.0은 다른 쪽 끝의 오프셋을 나타냅니다.

예시:

const gradient = ctx.createLinearGradient(0, 0, 100, 100);
gradient.addColorStop(0.0, Qt.rgba(1, 0, 0, 1));
gradient.addColorStop(0.5, "#ff8040");
gradient.addColorStop(1.0, "red");

point endPosition()

선형 그라데이션의 끝점을 반환합니다.

setEndPosition()도 참조하십시오 .

void setEndPosition(real x, real y)

선형 그라데이션의 끝점을 ( x, y)로 설정합니다.

endPosition()도 참조하십시오 .

void setEndPosition(point end)

선형 그라데이션의 끝점을 end 로 설정합니다.

이 함수는 오버로드된 함수입니다.

void setStartPosition(real x, real y)

선형 그라디언트의 시작점을 ( x, y)로 설정합니다.

startPosition()도 참조하십시오 .

void setStartPosition(point start)

선형 그라데이션의 시작점을 ` start`로 설정합니다.

이 함수는 오버로드된 함수입니다.

point startPosition()

선형 그라데이션의 시작점을 반환합니다.

setStartPosition()도 참조하십시오 .

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