Animating A Polygon?<p>Hi</p> <p>I have a polygon made up of a PointCollection...Is there any way to animate the points as a group?  I tried to name the points and animated them individually, but naming points is not allowed.</p>© 2009 Microsoft Corporation. All rights reserved.Thu, 05 Mar 2009 05:19:39 Zf9d6f99b-7bcb-44b7-9206-22fcd4266c3dhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f9d6f99b-7bcb-44b7-9206-22fcd4266c3d#f9d6f99b-7bcb-44b7-9206-22fcd4266c3dhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f9d6f99b-7bcb-44b7-9206-22fcd4266c3d#f9d6f99b-7bcb-44b7-9206-22fcd4266c3dmoonwalkercsshttp://social.msdn.microsoft.com/Profile/en-US/?user=moonwalkercssAnimating A Polygon?<p>Hi</p> <p>I have a polygon made up of a PointCollection...Is there any way to animate the points as a group?  I tried to name the points and animated them individually, but naming points is not allowed.</p>Wed, 17 Jan 2007 18:47:06 Z2007-01-17T18:47:06Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f9d6f99b-7bcb-44b7-9206-22fcd4266c3d#8828b3f1-809b-4292-836a-e9a47234b80bhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f9d6f99b-7bcb-44b7-9206-22fcd4266c3d#8828b3f1-809b-4292-836a-e9a47234b80bAnthony Hodsdon - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Anthony%20Hodsdon%20-%20MSFTAnimating A Polygon?<p>You can either dot down to the points using TargetPath, or convert the Polygon over to a Path containing a PathGeometry:</p> <blockquote dir=ltr style="margin-right:0px"> <p><font face="Courier New, Courier, Monospace">&lt;Canvas xmlns=&quot;</font><a title="http://schemas.microsoft.com/winfx/2006/xaml/presentation" href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"><font face="Courier New, Courier, Monospace">http://schemas.microsoft.com/winfx/2006/xaml/presentation</font></a><font face="Courier New, Courier, Monospace">&quot;<br>xmlns:x=&quot;</font><a title="http://schemas.microsoft.com/winfx/2006/xaml" href="http://schemas.microsoft.com/winfx/2006/xaml"><font face="Courier New, Courier, Monospace">http://schemas.microsoft.com/winfx/2006/xaml</font></a><font face="Courier New, Courier, Monospace">&quot;&gt;</font></p> <p><font face="Courier New, Courier, Monospace">    &lt;Canvas.Triggers&gt;<br>      &lt;EventTrigger RoutedEvent=&quot;Canvas.Loaded&quot;&gt;<br>&lt;BeginStoryboard&gt;<br>          &lt;Storyboard&gt;<br>            &lt;PointAnimation <br>   By=&quot;-20,-20&quot;<br>   Duration=&quot;0:0:2&quot;<br>   RepeatBehavior=&quot;Forever&quot;<br>   AutoReverse=&quot;True&quot;<br>   Storyboard.TargetName=&quot;figure1&quot;<br>   Storyboard.TargetProperty=&quot;StartPoint&quot;/&gt;<br>            &lt;PointAnimation <br>   By=&quot;40,40&quot;<br>   Duration=&quot;0:0:2&quot;<br>   RepeatBehavior=&quot;Forever&quot;<br>   AutoReverse=&quot;True&quot;<br>   Storyboard.TargetName=&quot;segment1&quot;<br>   Storyboard.TargetProperty=&quot;Point&quot;/&gt;<br>  &lt;PointAnimation <br>   By=&quot;50,40&quot;<br>   Duration=&quot;0:0:2&quot;<br>   RepeatBehavior=&quot;Forever&quot;<br>   AutoReverse=&quot;True&quot;<br>   Storyboard.TargetName=&quot;segment2&quot;<br>   Storyboard.TargetProperty=&quot;Point&quot;/&gt;<br>              &lt;PointAnimation <br>   By=&quot;-20,30&quot;<br>   Duration=&quot;0:0:2&quot;<br>   RepeatBehavior=&quot;Forever&quot;<br>   AutoReverse=&quot;True&quot;<br>   Storyboard.TargetName=&quot;segment3&quot;<br>   Storyboard.TargetProperty=&quot;Point&quot;/&gt;<br>    <br>       &lt;/Storyboard&gt;<br>&lt;/BeginStoryboard&gt;<br> &lt;/EventTrigger&gt;<br>    &lt;/Canvas.Triggers&gt;</font></p> <p><font face="Courier New, Courier, Monospace">&lt;Path Name=&quot;path&quot; Fill=&quot;#20000000&quot;&gt;<br>  &lt;Path.Data&gt;<br>    &lt;PathGeometry&gt;<br>      &lt;PathGeometry.Figures&gt;<br>        &lt;PathFigureCollection&gt;<br>          &lt;PathFigure x:Name=&quot;figure1&quot; IsFilled=&quot;True&quot; StartPoint=&quot;10, 100&quot;&gt;<br>            &lt;PathFigure.Segments&gt;<br>              &lt;PathSegmentCollection&gt;<br>                   &lt;LineSegment x:Name=&quot;segment1&quot; Point=&quot;20, 20&quot; /&gt;    <br>                   &lt;LineSegment x:Name=&quot;segment2&quot; Point=&quot;90, 100&quot; /&gt;<br>                   &lt;LineSegment x:Name=&quot;segment3&quot; Point=&quot;90, 200&quot; /&gt;<br>              &lt;/PathSegmentCollection&gt;<br>            &lt;/PathFigure.Segments&gt;<br>          &lt;/PathFigure&gt;<br>        &lt;/PathFigureCollection&gt;<br>      &lt;/PathGeometry.Figures&gt;<br>    &lt;/PathGeometry&gt;<br>  &lt;/Path.Data&gt;<br>&lt;/Path&gt;<br>&lt;/Canvas&gt;</font></p></blockquote>Wed, 17 Jan 2007 19:17:16 Z2007-01-17T19:17:16Z