![](/img/trans.png)
[英]How I get this kind of drop shadow Direction, Shadow depth, Color shown in the Tooltip (Click me) in this image in WPF?
[英]adjust drop shadow size in WPF. shown in the image
你不能為你的影子設置邊距,所以你可以“隱藏”另一個簡單的
邊界在你的“真實”邊界后面。
將它們包裹在一個網格中,將它們放在同一個地方。
在該邊框上設置邊距,並在其上設置陰影效果。
<Grid>
<Border Margin="20,20,0,0">
<Border.Effects>
<DropShadowEffect />
</Border.Effects/>
</Border>
<Border x:Name="YourOriginalBorder"/>
</Grid>
只需要在o_w的例子中的Border中添加Background屬性來顯示陰影,或者使用其他控件作為例子,比如button。
<Grid>
<Button Content="Button1" Width="150" Height="30">
<Button.Effect>
<DropShadowEffect BlurRadius="1" Color="Red" Direction="340" Opacity="10" ShadowDepth="30" RenderingBias="Quality" />
</Button.Effect>
</Button>
<Button Content="Button1" Width="200" Height="40" />
</Grid>
我想發表評論,但我剛剛加入 StackOverflow,我還不能這樣做:(。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.