QTI图片颜色变化大小缩放实现

Image {

        id: icon
        source: "image.png"
        visible: true
        Colorize {
            anchors.fill: parent
            source: icon
            hue: 0.1 - (158 - icon.width) / 58 * 0.1  //色调
            saturation: 1  //饱和度
            lightness: -0.2  //亮度
        }
        SequentialAnimation {
            id: iconAnimation
            property real widthEnd: 100
            property real heightEnd: 90
            ParallelAnimation {
                NumberAnimation { target: icon; property: "width"; to: iconAnimation.widthEnd; duration: 300 }
                NumberAnimation { target: icon; property: "height"; to: iconAnimation.heightEnd; duration: 300 }
            }
        }
    }

Image.png
放大效果
缩小效果

猜你喜欢

转载自blog.csdn.net/u011086209/article/details/84790731