<DoubleAnimationUsingPath
Storyboard.TargetName="MyRotateTransform"
Storyboard.TargetProperty="Angle"
Source="Angle"
Duration="0:0:5"
RepeatBehavior="Forever" AutoReverse="True" >
<DoubleAnimationUsingPath.PathGeometry>
<PathGeometry Figures="M 10,100 C 35,0 135,0 160,100 180,190 285,200 310,100" />
</DoubleAnimationUsingPath.PathGeometry>
</DoubleAnimationUsingPath>我现在知道的只是物体沿着曲线做曲线运动,曲线也是先画好的。不知道该怎么动画绘制曲线。
效果就是要跟人的手指在屏幕上画一条平滑的曲线一样。
求高手指点,给点思路也好啊。xaml的区人气太差了啊。我之前的一个求助帖,麻烦也帮忙看看。
http://bbs.csdn.net/topics/390488814
你可以这样试下。 <Storyboard x:Key="Storyboard1">
<DoubleAnimation From="0" To="1" Duration="0:0:5" Storyboard.TargetProperty="(Shape.Stroke).(LinearGradientBrush.GradientStops)[0].Offset" Storyboard.TargetName="path"/>
<DoubleAnimation From="0" To="1" Duration="0:0:5" Storyboard.TargetProperty="(Shape.Stroke).(LinearGradientBrush.GradientStops)[1].Offset" Storyboard.TargetName="path"/>
</Storyboard> <Path x:Name="path" Data="M 10,100 C 35,0 135,0 160,100 180,190 285,200 310,100" StrokeThickness="2">
<Path.Stroke>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Transparent" Offset="0"/>
</LinearGradientBrush>
</Path.Stroke>
</Path>