QML之动态图片
这个时候不能直接使用Image,得用AnimatedImage实现动图效果
Rectangle {
width: animation.width
height: animation.height + 8
AnimatedImage
{
id: animation
source: “123.gif”
}
Rectangle
{
property int frames: animation.frameCount
width: 4
height: 8
x: (animation.width - width) * animation.currentFrame / frames
y: animation.height
color: “red”
}
}