<Window
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 x:Name="Window"
 Title="ImageReflection"
 Width="400" Height="600" Background="#FF840909">
 
<Viewbox><!-- 可以理解为视窗-->
    <StackPanel Margin="10"><!--一个容器,用来装其他的控件,该控件从pannel派生-->
      <Border BorderBrush="White" BorderThickness="8" Width="262.999" Height="354.833" Background="#FF130202">
        <!--Border 可以理解为边框,BorderBrush为边框颜色,BorderThickness为边框厚度,-->
        <Image Source="vv9xyoiq3028.jpg" x:Name="myVisual" Stretch="Fill"/>
        <!--Source路径要设置正确,x:Name 相当于该控件的Name,Stretch 枚举类型,四个值:None,Fill,Uniform,UniformToFill -->
      </Border>
      <Border BorderBrush="White" BorderThickness="8" Width="263.621" Height="185.429">
        <Border.RenderTransform><!-- 这是控制框的倾斜-->
          <SkewTransform CenterX="0" CenterY="0" AngleX="-50" AngleY="0"/>
           <!--SkewTransform  从 Transform 派生-->
        </Border.RenderTransform>
        <Border.OpacityMask><!--透明性设置-->
          <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"><!--按线性渲染 LinearGradientBrush 从GradientBrush派生-->
           <GradientStop Offset="0" Color="#FF000000"/>
           <GradientStop Offset="0.8" Color="#00000000"/>
          </LinearGradientBrush>
        </Border.OpacityMask>
        <Border.Background>
          <VisualBrush Visual="{Binding ElementName=myVisual}"><!--VisualBrush 从 TileBrush派生
                    Visual为设置其 Brush的内容 -->
            <VisualBrush.RelativeTransform><!--设置翻转角度等-->
              <ScaleTransform ScaleX="1" ScaleY="-1" CenterX="0.5" CenterY="0.5"/>
            </VisualBrush.RelativeTransform>
          </VisualBrush>
        </Border.Background>
      </Border>
    </StackPanel>
  </Viewbox>
</Window>

posted on 2007-12-14 16:48  颜昌钢  阅读(908)  评论(0编辑  收藏  举报