开发者

How can we improve the performance of our WPF Animations (100 of them)?

We have an application that generates around 100 animations at runtime and they are all added to a single storyboard and then play开发者_运维技巧ed. The problem is that the animation is extremely slow. The objects that are being animated are shapes and splines and a good amount of computation is done in the backend for generating the custom splines. The running computer is a quad core with a good graphics card.

Any suggestions on how we can fix this? Do we need to split the animations into multiple storyboards or animate on different canvases?

Thank you


Its little difficult to know whats slowing down your animation without seeing animation and code. But I will give you general points that can help improving them.

  1. Move your calculation into different thread, if there is very heavy calculation. Dispatcher thread is busy doing your UI management so if you put everything into one thread that will certainly slow down things.
  2. Reuse your splines,shapes etc, this will certainly help you because you will also free your app from costly garbage collection routines. Infact before starting animation, display some different animation like clock etc to create all objects required in the beginning.
  3. Explore bitmap caching options and try to implement them.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜