恢复窗口后WPF缓慢重绘 [英] WPF slow repaint after window restored

查看:157
本文介绍了恢复窗口后WPF缓慢重绘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows XP .NET 4.0上运行的WPF应用程序上工作.此应用程序中的用户控件具有通过计时器进入网格的数据.

我注意到,重新绘制确实很慢,并且在将窗口置于前台或激活(最大化或还原)之后,对鼠标单击的响应滞后.如果我切换到另一个应用程序(例如"notepad/word/excel")并最小化了WPF wpp,然后将WPF应用程序置于前台或将其激活,则会发生这种情况.

任何信息.会有所帮助.

感谢

I am working on a WPF application running on Windows XP .NET 4.0. The usercontrols in this app have data going to the grid via a timer.

I have noticed that the repaint is really slow and response to mouse clicks lags after the window is brought to the foreground or activated (maximized or restored). This happens if I switch to another app like "notepad/word/excel" and have minimized my WPF wpp and then bring the WPF app to the foreground or activate it.

Any info. would help.

Thanks

推荐答案

对于运行您的应用程序的计算机,您的窗口可能太复杂了.

如果显示网格,则必须确保网格不会太大.正在显示数千行吗?

如果您的应用程序切换到另一个应用程序后滞后,则您可能没有足够的内存来存储所有正在运行的程序,并且系统交换了很多信息.

通过显示任务管理器,您可以对此有所了解.
Your windows is probably too complicated for the computer running your application.

If you display a grid, you have to ensure that your grid is not too large. Are displaying thousand of rows?

If your application lag after you switch to another application then you probably don,t have enough memory on your computer for all running programs and the system swap a lot.

You can have an idea about that by displaying the task manager.


菲利普,

Tkx供您输入.

我们的应用使用了大约19.4万.页面文件大小约为3 gb

下面是用户计算机配置文件

2011-07-20 08:04:50,194 [UIThread]信息SystemInformationProvider:操作系统:FreePhysicalMemory:832624
2011-07-20 08:04:50,210 [UIThread]信息SystemInformationProvider:操作系统:MaxProcessMemorySize:2097024
2011-07-20 08:04:50,210 [UIThread]信息SystemInformationProvider:操作系统:名称:Microsoft Windows XP Professional | C:\ WINDOWS |
2011-07-20 08:04:50,210 [UIThread]信息SystemInformationProvider:操作系统:ServicePackMajorVersion:3
2011-07-20 08:04:50,210 [UIThread]信息SystemInformationProvider:操作系统:ServicePackMinorVersion:0
2011-07-20 08:04:50,210 [UIThread]信息SystemInformationProvider:操作系统:TotalVirtualMemorySize:2097024
2011-07-20 08:04:50,210 [UIThread]信息SystemInformationProvider:操作系统:TotalVisibleMemorySize:3143248
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider:操作系统:版本:5.1.2600
2011-07-20 08:04:50,241 [UIThread]信息SystemInformationProvider:物理内存:容量:4294967296
2011-07-20 08:04:50,241 [UIThread]信息SystemInformationProvider:物理内存:MemoryBanksInUse:4
2011-07-20 08:04:50,256 [UIThread]信息SystemInformationProvider:处理器:名称1:Intel Pentium III Xeon处理器
2011-07-20 08:04:50,256 [UIThread]信息SystemInformationProvider:处理器:NumberOfCores1:4
2011-07-20 08:04:50,256 [UIThread]信息SystemInformationProvider:处理器:NumberOfLogicalProcessors1:4
2011-07-20 08:04:50,256 [UIThread]信息SystemInformationProvider:处理器:Name2:英特尔奔腾III Xeon处理器
2011-07-20 08:04:50,256 [UIThread]信息SystemInformationProvider:处理器:NumberOfCores2:4
2011-07-20 08:04:50,256 [UIThread]信息SystemInformationProvider:处理器:NumberOfLogicalProcessors2:4

我认为这更多是显示适配器/驱动程序,.NET 4 build等问题


Hi Philippe,

Tkx for you input.

Our app uses about 194K. The page file size is about 3 gb

Below is the user machine profile

2011-07-20 08:04:50,194 [UIThread] INFO SystemInformationProvider : Operating System: FreePhysicalMemory : 832624
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: MaxProcessMemorySize : 2097024
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: Name : Microsoft Windows XP Professional|C:\WINDOWS|
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: ServicePackMajorVersion : 3
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: ServicePackMinorVersion : 0
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: TotalVirtualMemorySize : 2097024
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: TotalVisibleMemorySize : 3143248
2011-07-20 08:04:50,210 [UIThread] INFO SystemInformationProvider : Operating System: Version : 5.1.2600
2011-07-20 08:04:50,241 [UIThread] INFO SystemInformationProvider : Physical Memory: Capacity : 4294967296
2011-07-20 08:04:50,241 [UIThread] INFO SystemInformationProvider : Physical Memory: MemoryBanksInUse : 4
2011-07-20 08:04:50,256 [UIThread] INFO SystemInformationProvider : Processor: Name1 : Intel Pentium III Xeon processor
2011-07-20 08:04:50,256 [UIThread] INFO SystemInformationProvider : Processor: NumberOfCores1 : 4
2011-07-20 08:04:50,256 [UIThread] INFO SystemInformationProvider : Processor: NumberOfLogicalProcessors1 : 4
2011-07-20 08:04:50,256 [UIThread] INFO SystemInformationProvider : Processor: Name2 : Intel Pentium III Xeon processor
2011-07-20 08:04:50,256 [UIThread] INFO SystemInformationProvider : Processor: NumberOfCores2 : 4
2011-07-20 08:04:50,256 [UIThread] INFO SystemInformationProvider : Processor: NumberOfLogicalProcessors2 : 4

I am believing this to be more of a display adapter/ driver , .NET 4 build etc issue


Any info. would help.

Thanks


每当我看到这样的问题时,它几乎总是归因于显示驱动程序问题.某些nvidia驱动程序在激活应用程序时表现异常.您可能需要获取有关机器的更新驱动程序.
Whenever I have seen an issue like this, it has pretty much always been due to a display driver issue. Certain nvidia drivers perform horribly when activating the application. You might need to get updated drivers for the machine in question.


这篇关于恢复窗口后WPF缓慢重绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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