QML实现图片阴影效果
import QtQuick
Window {
width: 640
height: 480
visible: true
title: qsTr("GrayImage")
Image {
id: no_shadow
x: 100
y: 100
source: 'assets/Balatro.png'
}
BorderImage {
anchors.fill: with_shadow
anchors {
leftMargin: -6
topMargin: -6
rightMargin: -8
bottomMargin: -8
}
border {
left: 10
top: 10
right: 10
bottom: 10
}
source: 'assets/shadow.png'
}
Image {
id: with_shadow
x: 300
y: 100
source: 'assets/Balatro.png'
}
}
—
https://gitcode.com/razorrazor/QMLBasic/tree/main/ShadowRectangle