开发者

Are there rendering performance differences between using ScaleTransform and setting the size directly?

开发者 https://www.devze.com 2023-01-05 00:53 出处:网络
As far as rendering performance is concerned, has a Rectangle with a size of 5000x5000 different performance charact开发者_StackOverfloweristics than a Rectangle with a size of 5x5 and a ScaleTransfor

As far as rendering performance is concerned, has a Rectangle with a size of 5000x5000 different performance charact开发者_StackOverfloweristics than a Rectangle with a size of 5x5 and a ScaleTransform (LayoutTransform) of 1000?


The rendering performance difference is negligible:

  • The layout pass is very slightly slower when a LayoutTransform is present, since it must be propagated down the rendering tree, and
  • The coordinate transforms are very slightly slower when a LayoutTransform is present, since they must apply the LayoutTransform to the four corners of the rectange, BUT
  • When it comes to actually drawing pixels onto the screen there is no difference at all.

Drawing pixels is usually most of the work.

Unless you are drawing very large numbers of very small rectangles, you won't notice the difference.

0

精彩评论

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