In questa pagina

CanvasGradient QML Type

Fornisce un'interfaccia CanvasGradient opaca. Altro...

Import Statement: import QtQuick

Metodi

Descrizione dettagliata

Documentazione del metodo

CanvasGradient addColorStop(real offset, string color)

Aggiunge un punto di colore con l'color specificato al gradiente in corrispondenza dell'offset specificato. 0,0 corrisponde all'offset a un'estremità del gradiente, mentre 1,0 corrisponde all'offset all'altra estremità.

Ad esempio:

var gradient = ctx.createLinearGradient(0, 0, 100, 100);
gradient.addColorStop(0.3, Qt.rgba(1, 0, 0, 1));
gradient.addColorStop(0.7, 'rgba(0, 255, 255, 1)');

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