在 WPF 中调整投影大小。如图所示
adjust drop shadow size in WPF. shown in the image
我尝试在 WPF 中调整投影效果的大小。但是我没有找到任何答案。
你不能为你的阴影设置边距,所以你可以“隐藏”另一个简单的
您的“真实”边框后面的边框。
将它们包裹在一个网格中,将它们放在同一个地方。
在该边框上设置边距,并在其上设置阴影效果。
<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>
我想 post 发表评论,但我刚刚加入 Whosebug,我还不能这样做:(。
我尝试在 WPF 中调整投影效果的大小。但是我没有找到任何答案。
你不能为你的阴影设置边距,所以你可以“隐藏”另一个简单的
您的“真实”边框后面的边框。
将它们包裹在一个网格中,将它们放在同一个地方。
在该边框上设置边距,并在其上设置阴影效果。
<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>
我想 post 发表评论,但我刚刚加入 Whosebug,我还不能这样做:(。