c# - WPF白屏渲染问题

标签 c# wpf windows-8.1

我正在接管遗留 WPF 应用程序。 我注意到它偶尔会在启动时显示白屏。这不会一直发生。只有当我将鼠标移到屏幕上时,我才会开始看到绘制的 UI 部分。我从来没有绘制过整个 UI 并且必须重新启动应用程序。

我们在 windows 8.1 和 .net 4.5 上

抱歉,信息量最少,但提供有关查找位置的线索会很棒。

最佳答案

虽然实际上不知道代码在做什么,但看起来 WPF 渲染线程没有跟上,我建议您尝试一些事情:

  1. 在不同的机器/显卡上尝试这个,看看是否发生相同的行为
  2. 你能检查一下你的 CPU 是否在做大量工作吗?
  3. 检查您的内存力是否在不断增加?
  4. 分析应用程序(垃圾收集、生成大小等)

但是,最好是开始查看代码,这可能只是一个导致 UI 困惑的错误。

在此处查看一些故障排除提示

Graphics card troublehooting

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.

关于c# - WPF白屏渲染问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40310645/

相关文章:

WPF 工具提示样式

尝试获取类型的实例时发生 WPF 统一激活错误

c# - 从位图图像裁剪图像

c# - WPF 径向进度条/仪表(即电池表)

c# - Unicode 输入 Windows 8.1 Store App

c# - 带有一些符号的名称的正则表达式

c# - 创建转换器时未列出 Entity Framework 导航属性

c# - 如何绑定(bind)静态BitmapSource?

c# - Windows 8.1 音频流不在后台播放

c# - 我应该等待使用 TaskCompletionSource 的同步 Task<T> 吗?