带有阴影效果的路径 [英] Path with broken shadow effect

查看:107
本文介绍了带有阴影效果的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望图像中的图像足够清晰,我有一个三角形的阴影效果看起来不太好,似乎以某种方式被破坏了. 任何帮助将不胜感激.

I hope that it is clear enough in the image, I have a triangle with shadow effect that doesn't look so good, seems to be broken somehow. Any help will be greatly appreciated.

(更新:矩形和路径必须分开)

(Update: the rectangle and the path have to be separated)

XAML:

    <Grid Height="50" Width="60" >
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Rectangle Grid.Column="1" Stroke="Black" Fill="White">
            <Rectangle.Effect>
                <DropShadowEffect Opacity="0.5" ShadowDepth="4" BlurRadius="10" />
            </Rectangle.Effect>
        </Rectangle>
        <Path Fill="White" Stretch="Fill" Stroke="Black" HorizontalAlignment="Left" Margin="0,15,-1,15"
                        Data="M44.386378,164.8791 L22.983157,171.42119 44.713478,176.58567" Width="23.167">
            <Path.Effect>
                <DropShadowEffect BlurRadius="10" Opacity="0.5" ShadowDepth="4" />
            </Path.Effect>
        </Path>
    </Grid>
</Grid>

推荐答案

在您的三角形上:

  1. 删除保证金
  2. 显式设置路径高度("22"与您所拥有的高度非常接近).

那应该防止三角形的阴影被修剪.

That should prevent the triangle's shadow from being clipped.

这是xaml:

    <Grid Height="50" Width="60" >
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="20" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Rectangle Grid.Column="1" Stroke="Black" Fill="White" >
        <Rectangle.Effect>
            <DropShadowEffect Opacity="0.5" ShadowDepth="4" BlurRadius="10" />
        </Rectangle.Effect>
    </Rectangle>
    <Path Fill="White" Stretch="Fill" Stroke="Black" HorizontalAlignment="Left" 
        Data="M44.386378,164.8791 L22.983157,171.42119 44.713478,176.58567" Width="23.167" Height="22">
        <Path.Effect>
            <DropShadowEffect BlurRadius="10" Opacity="0.5" ShadowDepth="4" />
        </Path.Effect>
    </Path>
</Grid>

这篇关于带有阴影效果的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆