<Window x:Class="WpfApplication2.Window6"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window6" Height="800" Width="400" Background="#FF840909">
<Viewbox>
<StackPanel Margin="10">
<Border BorderBrush="White" BorderThickness="8"
Width="262.999" Height="354.833" Background="#FF130202">
<Image x:Name="myVisual" Stretch="Fill"
Source="/WpfApplication2;component/images/e31b7dcada9a3077b700c8ea.jpg" />
</Border>
<Border BorderBrush="White" BorderThickness="8" Width="263.621" Height="185.429">
<Border.RenderTransform>
<SkewTransform CenterX="0" CenterY="0" AngleX="-50" AngleY="0"/>
</Border.RenderTransform>
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#FF000000"/>
<GradientStop Offset="0.8" Color="#00000000"/>
</LinearGradientBrush>
</Border.OpacityMask>
<Border.Background>
<VisualBrush Visual="{Binding ElementName=myVisual}">
<VisualBrush.RelativeTransform>
<ScaleTransform ScaleX="1" ScaleY="-1" CenterX="0.5" CenterY="0.5"/>
</VisualBrush.RelativeTransform>
</VisualBrush>
</Border.Background>
</Border>
</StackPanel>
</Viewbox>
</Window>
效果图如下:
作者:wpf之家
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。