WPF/E Video Reflection

Boy this was so simple I cracked up when I saw it work.

After the presentation at INETA where I described that once an object is on the canvas it is 'an object' and you can deal with it like any other object, I got to thinking about putting a wmv file into the Reflection Builder code... and it worked just fine!

 



Grrr... I forgot the xaml...

At the last minute, I decided to post the animation on the article page, and forgot to bring the xaml code over. I'll fix that tonight.

Another note:

WPF/E doesn't allow me to 'copy' what's going on and reflect it like WPF does, so this is really two copies running. If it starts out of sync, try hitting "restart animation" and see if it catches up. I've not had a problem that couldn't be fixed by doing that.

For now, here's the xaml for that animation:


<Canvas 
   xmlns="http://schemas.microsoft.com/client/2007"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <Canvas>
     <Canvas x:Name="MainImageCanvas" Canvas.Left="0" Canvas.Top="65">

   <MediaElement x:Name="MainImage" Source="bud_ads2.wmv" Width="300" Height="300" >
   </MediaElement>
        <Canvas.RenderTransform>
       <TransformGroup>
              <SkewTransform x:Name="MainSkewTransform" AngleY="-19" AngleX="0" CenterX="0" CenterY="0"/> 
              <ScaleTransform x:Name="MainScaleTransform" ScaleY="1" ScaleX = "1" CenterX="0" CenterY="0"/>
       </TransformGroup>
        </Canvas.RenderTransform>
     </Canvas>

     <Canvas x:Name="ReflectionImageCanvas" Canvas.Left="227" Canvas.Top="587">
     
   <MediaElement x:Name="ReflImage" Source="bud_ads2.wmv" Width="300" Height="300" Volume="0">
   </MediaElement>

       <Canvas.RenderTransform>
          <TransformGroup>
             <SkewTransform x:Name="ReflectionSkewTransform" AngleY="19" AngleX="-41" CenterX="0" CenterY="0" />
             <ScaleTransform x:Name="ReflectionScaleTransform" ScaleY="-1" ScaleX="1" CenterX="0" CenterY="0" />
          </TransformGroup>
       </Canvas.RenderTransform>

      <Canvas.OpacityMask>
         <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
         <GradientStop Offset="0.345" Color="#00000000" x:Name="ReflGradientStop1" /> 
            <GradientStop Offset="1.0" Color="#CC000000" x:Name="ReflGradientStop2" /> 
         </LinearGradientBrush>
      </Canvas.OpacityMask>

     </Canvas>

  </Canvas>


</Canvas>

posted @ Tuesday, February 06, 2007 5:53 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345