CanvasGradient QML Type
Fournit une interface `CanvasGradient` opaque. En savoir plus…
| Import Statement: | import QtQuick |
Méthodes
- CanvasGradient addColorStop(real offset, string color)
Description détaillée
Documentation de la méthode
CanvasGradient addColorStop(real offset, string color)
Ajoute un arrêt de couleur avec l'color spécifiée au dégradé situé à l'offset indiquée. 0,0 correspond au décalage à une extrémité du dégradé, 1,0 à l'autre extrémité.
Par exemple :
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.