Category: 软件[Code]

CODE

<Window x:Class=”WpfApplication1.MainWindow”
       xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation
       xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml
       x:Name=”Window”
       Title=”Path Opacity Mask Animation Demo”
       Width=”640″ Height=”480″ xmlns:System=”clr-namespace:System;assembly=mscorlib”>

       <Window.Resources>
              <Storyboard x:Key=”Timeline1″>
                     <DoubleAnimationUsingKeyFrames BeginTime=”00:00:00″ Storyboard.TargetName=”path1″      Storyboard.TargetProperty=”(Shape.StrokeDashOffset)”>
                           <SplineDoubleKeyFrame KeyTime=”00:00:01″ Value=”25″/>
                           <SplineDoubleKeyFrame KeyTime=”00:00:02″ Value=”0″/>
                     </DoubleAnimationUsingKeyFrames>
                     <DoubleAnimationUsingKeyFrames BeginTime=”00:00:00″ Storyboard.TargetName=”path2″  Storyboard.TargetProperty=”(Shape.StrokeDashOffset)”>
                           <SplineDoubleKeyFrame KeyTime=”00:00:03″ Value=”25″/>
                           <SplineDoubleKeyFrame KeyTime=”00:00:04″ Value=”0″/>
                     </DoubleAnimationUsingKeyFrames>
    </Storyboard>
       </Window.Resources>
       <Window.Triggers>
              <EventTrigger RoutedEvent=”FrameworkElement.Loaded”>
                     <BeginStoryboard Storyboard=”{StaticResource Timeline1}”/>
              </EventTrigger>
       </Window.Triggers>

       <Grid x:Name=”LayoutRoot”>
              <Image Source=”Hydrangeas.jpg” Stretch=”Fill”>
      <Image.OpacityMask>
    <VisualBrush>
             <VisualBrush.Visual>
               <Path x:Name=”path1″ Stretch=”Fill” Stroke=”#FF000000″ StrokeDashOffset=”1000″ StrokeEndLineCap=”Round” StrokeStartLineCap=”Round” StrokeThickness=”20″ HorizontalAlignment=”Left” Margin=”228,145.336,0,188.972″ Width=”71″ Data=”M294,171 C289,162 283,147 268,151 253,155 244,164.99992 244,177.00008 244,189.00024 284,196.00033 287,207.00047 290,218.00062 286,249.00103 259,250.00104 232,251.00105 235,225.00071 233,219.00063″ StrokeDashArray=”25 1000″/>
             </VisualBrush.Visual>
           </VisualBrush>
    </Image.OpacityMask>
     </Image>
    
    <Path x:Name=”path2″ Stretch=”Fill” Stroke=”#FF000000″ StrokeDashOffset=”1000″ StrokeEndLineCap=”Round” StrokeStartLineCap=”Round” StrokeThickness=”20″ HorizontalAlignment=”Left” Margin=”228,145.336,0,188.972″ Width=”71″ Data=”M294,171 C289,162 283,147 268,151 253,155 244,164.99992 244,177.00008 244,189.00024 284,196.00033 287,207.00047 290,218.00062 286,249.00103 259,250.00104 232,251.00105 235,225.00071 233,219.00063″ StrokeDashArray=”25 1000″/>
          
  </Grid>
</Window>


Here it goes. Build Unity 3D multitouch application on Windows 7 machines.

This video demonstrates an application built with Unity 3D with Windowns 7 multitouch input.

Thanks to Unity explosion framework Detonator. Nice work!