是否WPF刷新绘图类似于Windows窗体? [英] Does WPF refresh drawing similar to Windows Forms?

查看:114
本文介绍了是否WPF刷新绘图类似于Windows窗体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,如果我有一个WPF窗口,将移动另一个窗口在WPF窗口使WPF窗口做成千上万重绘像Windows窗体?

So if I have a WPF window, would moving another window over the WPF window cause the WPF window to do thousands of redraws like Windows Forms?

我想知道使用的载体在此情况下的效果,而不是一切是基于位图像窗口形式

I am wondering the effects of using vectors in this case, as opposed to everything being bitmap-based like Window Forms.

推荐答案

您可以采取偷看的 WPF架构得到了它是如何建立一个主意。

You can take a peek at the WPF architecture to get an idea of how it's set up.

要回答你的具体问题:WPF使用一个保留模式绘制系统。具体而言,这意味着任何必要的重绘(这可能是必要的)是在幕后处理,无需人工干预。

To answer your specific question: WPF uses a retained mode drawing system. In particular, that means that any redrawing necessary (which may be necessary) is handled behind the scenes without your intervention.

相反,GDI使用即时模式;例如,你基本上是直接写的像素,如果 - 对于任何推理这些像素需要刷新,则需要重新呈现。

By contrast, GDI uses immediate mode; i.e. you essentially write pixels directly and if -for any reason- those pixels need refreshing, you need to re-render.

WPF不的不一定的实际缓存的一切 - 这取决于操作系统和内存可用性除其他事项。但是,如果确实需要重新渲染,它会使用您上次提供这样做的场景图;这是对程序员透明。此外,尽管它使用的DirectX,这基本上只是意味着它在做一个尽力而为的情况下使用的硬件支持,只要有供应,实现该功能。并不是所有的显卡也不是所有的WPF功能全面加速。 <一href="http://stackoverflow.com/questions/149763/how-do-you-determine-if-wpf-is-using-hardware-or-software-rendering">This问题的担忧告诉了不同的读解方式分开,这就需要造成的。

WPF doesn't necessarily actually cache everything - that depends on the OS and memory availability amongst other things. However, if it does need to re-render, it'll use the scene graph you last provided to do so; it's transparent to the programmer. Also, even though it "uses" DirectX, that basically just means it's doing a best-effort case to use hardware support insofar available and implemented for that feature. Not all graphics cards nor all WPF features are fully accelerated. This question concerns telling the different rending modes apart and the consequence that entails.

这篇关于是否WPF刷新绘图类似于Windows窗体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆