2015-12-30 46 views
1

如何在Windows通用應用程序中添加陰影效果?Windows通用應用程序中的Image/StackPanel的陰影效果

我已經將圖像添加到StackPanel中。我想爲該控件添加陰影效果(StackPanel)。

我正在嘗試做類似下面的圖像。

enter image description here

+0

您是否找到了解決方案? – meetme

+0

不,我不能。在Window Universal App中沒有任何直接的方法。 – DSA

回答

1

這應該給你靈感,你喜歡的東西到達。

Drop Shadow Effect

<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
    <Grid Width="100" Height="100" Margin="0,10"> 
     <Image Source="PinkSquare.png" Width="95" Height="95" HorizontalAlignment="Right" VerticalAlignment="Bottom" Opacity="0.5"/> 
     <Image Source="PinkSquare.png" Width="95" Height="95" HorizontalAlignment="Left" VerticalAlignment="Top"/> 
    </Grid> 

    <Grid Width="100" Height="100" Margin="0,10"> 
     <Image Source="GraySquare.png" Width="95" Height="95" HorizontalAlignment="Right" VerticalAlignment="Bottom" Opacity="0.5"/> 
     <Image Source="PinkSquare.png" Width="95" Height="95" HorizontalAlignment="Left" VerticalAlignment="Top"/> 
    </Grid> 
</StackPanel> 

添加邊框,圓角,漸變等方式來實現你喜歡的最終外觀。