Hi all,
I want to apply a series of transforms to a canvas. The transforms
consist of scales, rotates and translates. They will to have be applied
dynamically and in a random order. For instance: a canvas is translated
but next it will have to be rotated around a certain center, scaled
around a center, rotated again, translated again, ... I used a
transformgroup and because I know that the order of transforms is
important, I added them to the transformgroup in a way the first in the
group are all the scales, next the rotates and finally the translates.
This works well for a while but after a certain time a get performance
problems when there are too many transforms in the group. Is there a way
to overcome this?
Thx al lot,
Maarten
Loading
Patrick KlitzkePosted Jun 13, 2009, 3:44 AM
The performance issue could have to do with several things.
First: Do you use Canvas.Rendertransform or Canvas.LayoutTransform? Layouttransform causes the Application the call an entire Layoutprocess, which takes much more time than Rendertransform.
But I think your problem is, that you may call all the functions in the loop. This is critical, since the transformation has not been finished, before a other transformation is called. I would reccomand to use the class DispatcherTimer from System.Windows.Threading: