Quantcast
Channel: 2,000 Things You Should Know About WPF » Transform
Viewing all articles
Browse latest Browse all 3

#782 – A RenderTransform Has Better Performance than a LayoutTransform

$
0
0

When you transform a 2D element, you specify the desired transform as either a layout transform (transform calculated before layout phase) or a render transform (transform calculated before rendering the element).

A render transform has better performance than a layout transform.  This is especially apparent when you are animating a transform.  Whenever a layout transform changes, the panel containing the element that is being transformed needs to recalculate the layout of the children within the panel.  With a render transform, by contrast, the element only needs to be re-rendered.  Because of the additional layout step, a layout transform is more compute intensive than a render transform.

Because of the performance differences, you should use a render transform by default, unless you need the layout of the elements to change when the transform changes.

 


Filed under: Layout Tagged: Layout, LayoutTransform, RenderTransform, Transform, WPF

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images