QML 中的定向阴影
Directional Shadows in QML
是否可以在 QML 元素上定义方向阴影,使阴影只投射到对象的一侧?
我只能找到 DropShadow
元素。但这会在四面八方产生阴影,可以使用偏移来移动阴影。但是影子总是会比原来的物体大。
我想要一些非常像 this answer 中所示的东西来回答 CSS 中关于阴影的问题。
作为你的 link 那 attached
这里使用颜色渐变,不要与阴影混淆。
Rectangle
{
x: 150
y: 111
width: 152
height: 112
color: "#1e8784"
Rectangle
{
x: 0
y: 97
width: 152
height: 15
color: "#f159bf"
gradient: Gradient {
GradientStop {
position: 0.00;
color: "#ff20a2";
}
GradientStop {
position: 0.42;
color: "#f583cf";
}
GradientStop {
position: 1.00;
color: "#ffffff";
}
}
}
}
是否可以在 QML 元素上定义方向阴影,使阴影只投射到对象的一侧?
我只能找到 DropShadow
元素。但这会在四面八方产生阴影,可以使用偏移来移动阴影。但是影子总是会比原来的物体大。
我想要一些非常像 this answer 中所示的东西来回答 CSS 中关于阴影的问题。
作为你的 link 那 attached
这里使用颜色渐变,不要与阴影混淆。
Rectangle
{
x: 150
y: 111
width: 152
height: 112
color: "#1e8784"
Rectangle
{
x: 0
y: 97
width: 152
height: 15
color: "#f159bf"
gradient: Gradient {
GradientStop {
position: 0.00;
color: "#ff20a2";
}
GradientStop {
position: 0.42;
color: "#f583cf";
}
GradientStop {
position: 1.00;
color: "#ffffff";
}
}
}
}