How to draw an arc in winRT with animation?

后端 未结 4 2052
梦毁少年i
梦毁少年i 2021-01-03 02:43

I am a newbie to WinRT and Blend and I need to draw digits 1, 2 etc with drawing effect in my WinRT application. The requirement is like the application will be drawing the

4条回答
  •  心在旅途
    2021-01-03 03:16

    WinRT XAML Toolkit has a RingSlice control that you could also use and animate its StartAngle/EndAngle to easily animate an arc turning into a circle. Note though that both this and Iris' solutions require setting EnableDependentAnimation on an animation which is a safeguard telling you that they might not perform very well since they require code running on UI thread and will cause layout recalculations which are slow especially in complicated scenes. One thing I would try if it turns out slow (especially on slow devices like the ARM ones) would be to overlay smaller arcs with same center point and rotate them with RenderTransform animations around that center point to get the same effect. This would be a bit more complicated, but has a chance of running faster. You would balance the cost of animating on UI thread vs. overlaying multiple arcs and orchestrating their animation sequence.

提交回复
热议问题