How do you determine if WPF is using Hardware or Software Rendering?

前端 未结 7 1190
借酒劲吻你
借酒劲吻你 2020-11-27 16:06

I\'m benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering.

I seem to recall a cal

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 16:29

    .NET 4.0 provides the ability to force software rendering in code:

    public partial class App : Application 
    {    
        protected override void OnStartup(StartupEventArgs e)    
        {         
            if (WeThinkWeShouldRenderInSoftware())            
                RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;    
        }
    }
    

    See this post for more information.

提交回复
热议问题