Does WPF use native Windows contols?

偶尔善良 提交于 2019-12-10 15:44:18

问题


Does it perform drawing by itself, or uses the native UI components provided by Windows in any way?


回答1:


WPF sort of uses native controls because WPF is the new native way to render controls in Windows - what you consider native is legacy win32, and basically slowly on the way to history.

MS did a lot of optimization in DirectX to allow WPF efficiently to render using the GPU. This is a new "native" interface that is also used to render the Vista upward AERO interface. WPF goes directly to a native layer that then does whatever it can in the GPU - including text rendering.

Now, the reall tricky part in your question is "native UI components provided by windows in ANY MEANS" - well, these low level functions are provided by Windows, so the answer is yes. Primitive drawing operations in a new API were added, but they were added specifically FOR WPF, which is now considered to be sort of the new "native windows presentation layer". MS is slowly moving away from the Win32 API towards WPF for generic presentations (Direct X etc. stays around - WPF is way too generic to be usable for example for high performance first person shooters). As such, given WPF is the new "native components layer", the question gets really tricky to answer ;)




回答2:


In WPF you can skin all of the controls in whatever way you please by overriding the templates. You absolutely can't do this with win32 controls, so therefore it can't use them.




回答3:


It uses DirectX 9 to perform all its drawing. It doesn't use WinForms controls



来源:https://stackoverflow.com/questions/2752603/does-wpf-use-native-windows-contols

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!