1 Star 0 Fork 0

dodofung/DemoCloudMusicPlayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MusicRoundImage.qml 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
dodo.feng 提交于 2024-12-19 06:57 . SmallWindow Mode
import QtQuick 2.0
import QtQuick.Controls 2.12
//import QtGraphicalEffects 1.0
import QtGraphicalEffects 1.15
Rectangle {
property string imgSrc: "qrc:/images/player.jpg"
property int borderRadius: 5
property bool enableAnimation: false
property bool pauseAnimation: false
property int outerFrameWidth: 0
gradient: Gradient
{
id:gradBackground
GradientStop{
position: 0
color:"#102030"
}
GradientStop{
position: 1
color:"#e0d0f0"
}
}
radius: borderRadius
id:roundImg
Item{
anchors.fill: parent
Image{
id:img
anchors.centerIn: parent
width: parent.width - outerFrameWidth
height: parent.height - outerFrameWidth
smooth: true
antialiasing: true
source: imgSrc
fillMode: Image.PreserveAspectCrop
visible: false
}
Rectangle{
visible: false
id:mask
color: "black"
radius: borderRadius
anchors.fill: parent
smooth: true
antialiasing: true
}
OpacityMask{
anchors.fill: img
source: img
maskSource: mask
visible: true
smooth: true
antialiasing: true
id:opacmask
}
id:innerItem
}
NumberAnimation {
target: opacmask
running: enableAnimation
paused: pauseAnimation
property: "rotation"
duration: 20000
from: 0
to:360
id:animImg
loops: Animation.Infinite
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dodofung/demo-cloud-music-player.git
git@gitee.com:dodofung/demo-cloud-music-player.git
dodofung
demo-cloud-music-player
DemoCloudMusicPlayer
master

搜索帮助