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 6, 2007 5:53 AM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«May»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678