How to animate a Image with color?
-
title,
ColorAnimation { target: colorLay; to: "#80000000"; duration: 100 }
ColorOverlay {
id: colorLay
anchors.fill: myImage
source: myImage
color: "#80800000"
}there is not work
-
title,
ColorAnimation { target: colorLay; to: "#80000000"; duration: 100 }
ColorOverlay {
id: colorLay
anchors.fill: myImage
source: myImage
color: "#80800000"
}there is not work
@Cheng-shi-hua hi
you want to animate the color property of the ColorOverlay , you can do it like thisApplicationWindow { width: 800 height: 600 visible: true Item { width: 300 height: 300 Image { id: img source: "image.jpg" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } ColorOverlay { ColorAnimation on color { from:Qt.rgba(1,0,0,0.2) to: Qt.rgba(0,0,1,0.2) //loops: Animation.Infinite duration: 500 } id: colorLay anchors.fill: img source: img color: col } } }
-
@Cheng-shi-hua hi
you want to animate the color property of the ColorOverlay , you can do it like thisApplicationWindow { width: 800 height: 600 visible: true Item { width: 300 height: 300 Image { id: img source: "image.jpg" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } ColorOverlay { ColorAnimation on color { from:Qt.rgba(1,0,0,0.2) to: Qt.rgba(0,0,1,0.2) //loops: Animation.Infinite duration: 500 } id: colorLay anchors.fill: img source: img color: col } } }
@LeLev
thanks!If this is not ColorOverlay , how to animate a Image?
-
@LeLev
thanks!If this is not ColorOverlay , how to animate a Image?
@Cheng-shi-hua said in How to animate a Image with color?:
how to animate a Image?
you will not animate the Image it self, what property of the image you want to animate ?
-
@Cheng-shi-hua said in How to animate a Image with color?:
how to animate a Image?
you will not animate the Image it self, what property of the image you want to animate ?
@LeLev
what property of the image you want to animate ?
property color
buy Image have no property color
so, how to animate color with Image -
@LeLev
what property of the image you want to animate ?
property color
buy Image have no property color
so, how to animate color with Image