Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
Guidelines for troubleshooting graphic issues in WPF applications
Article ID: 963021 - View products that this article applies to.
RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
Windows Presentation Foundation (WPF) differs from prior application platforms on Windows in that it uses its own DirectX-based hardware-accelerated rendering pipeline, when available, to draw the contents of any WPF windows. Prior application platforms were typically much less dependent on display driver quality because the bulk of their rendering was done in software rather than hardware. As a result, the visual quality of WPF applications is heavily dependent on the quality of the system’s display device and its display drivers. Faulty display devices may cause drawing artifacts within WPF applications or elsewhere on the desktop when an application uses the WPF hardware-rendering pipeline. This article describes how to troubleshoot WPF hardware-rendering artifacts and steps to resolve the problem.
For more information about the WPF rendering pipelines, see the Optimizing Performance: Taking Advantage of Hardware
(http://msdn.microsoft.com/en-us/library/bb613578.aspx)article on MSDN.
Graphic issues in WPF applications can include any of the following symptoms:
· A WPF window that fails to refresh.
· A WPF window that contains distorted and corrupted visuals.
· On Windows Vista, the screen flickers.
· On Windows XP, a blue screen crash sometimes occurs.
· The occurrence of a Timeout Detection and Recovery (TDR
Graphic issues in WPF applications are most commonly caused by a faulty graphics card or display driver. A TDR is most often caused by low-end display devices lacking the bandwidth and/or processing power to complete rendering in a reasonable amount of time.
To resolve graphic issues in WPF applications, there are several steps that you can perform. These steps include installing the most recent version of the .NET Framework and operating system service packs, installing the most up-to-date drivers for your graphics card, using a different graphics card or a graphics card from a different vendor, disabling hardware acceleration, and contacting Microsoft.
Steps to resolve graphic issues in WPF applications
1. The first step is to install the most recent version of the .NET Framework. You can get the latest version of the .NET Framework from the .NET Framework Developer Center
(http://msdn.microsoft.com/en-us/netframework/default.aspx). Also use Windows Update to ensure that you have installed the latest service pack for your operating system, as well as, all recent updates.
2. The next step is to obtain and install the most recent drivers for your graphics card. Visit the Web site of your graphics card’s or system’s manufacturer to obtain the latest drivers. Furthermore, it is always a good idea to upgrade your system BIOS to the latest version that is available, as there may be fixes pertaining to your graphics card in the most up-to-date system BIOS. Visit the Web site of your system manufacturer to obtain the most recent system BIOS for your computer. You can then re-launch your application to see whether the issue is resolved or is persistent.
3. If the issue persists, try launching your application on another computer with a different model/brand of graphics card and the most up-to-date drivers. This will indicate whether the issue is due to bugs in the display drivers. Occasionally, the most recent display drivers may not contain a fix for graphic issues. For example, if the particular graphics card that you are using is obsolete and its vendor does not support it anymore, the most recent drivers might not fix your issue.
4. If updating the display driver does not resolve the issue, and if you do not have a second computer to debug the issue, try disabling hardware acceleration and forcing your WPF application to use software rendering. You can disable WPF hardware acceleration by setting a system-wide registry key as described in Graphics Rendering Registry Settings
(http://msdn.microsoft.com/en-us/library/aa970912.aspx)article on MSDN. This forces all WPF applications on the computer to use the software rendering pipeline which bypasses the system’s graphics hardware. If the issue is resolved by using software rendering, then the cause is most likely your graphics hardware or its display drivers. Contact the technical support team of your graphics hardware vendor for further help.
5. If the issue is resolved by using software rendering and it is not possible for you to upgrade the physical graphics card or its drivers, then it is recommended that you disable hardware acceleration and force your WPF application to use software rendering as a workaround for your application. You can use the new software rendering API that is available in the .NET Framework 3.5 or later to achieve this. The new API allows developers to force software rendering of their applications (per window), rather than using a registry key to force ALL WPF applications on a computer to use software rendering and slowing down their performance. For details on how to achieve this, read item 6 in the Performance improvements in WPF in .NET 3.5 / 3.0 SP1
6. If none of the previous steps resolves the issue, then send the DirectX Diagnostics log from your computer to Microsoft so that it can be further analyzed. To obtain the DirectX log details of your computer, click the Start button and then click Run. In the Run dialog box, type dxdiag.exe and click OK. If you are asked whether you would like the DxDiag tool to check the digital signature of your drivers, select Yes. Once the tool finishes obtaining detailed information about your computer, click Save All Information to save the diagnostics information as a text file. To send your graphics issue to Microsoft, visit Microsoft Connect
(http://connect.microsoft.com/)and create a bug. In the bug, include the diagnostics file, a description of the issue, a sample application that demonstrates the problem, and a screenshot.
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.