奇怪的断断续续WPF动画 [英] Strange Choppy WPF Animation

查看:394
本文介绍了奇怪的断断续续WPF动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个应用程序,滚动在桌面上的信息。该窗口是透明的。我开始了简单,试图找到最低的CPU用于动画制作的东西,我开始用一个简单的TextBlock。

I am making an app that scrolls information on the desktop. The window is transparent. I am starting out simple, trying to find the lowest CPU use for animating things and I am starting with a simple TextBlock.

在我的机器,我得到在屏幕设置Canvas.Left属性与DoubleAnimation是一个非常流畅的动画效果。然而,在另一Vista计算机,我得到约1秒的滞后,每6到7秒。在XP的机器,这又是比较顺利的。我尝试了3其他机器和它的50%的好和坏。我有3.5 SP1安装在所有的机器。

On my development machine, I get a very smooth animation across the screen setting the Canvas.Left property with a DoubleAnimation. However, on another Vista computer I get about a 1 second lag every 6 to 7 seconds. On an XP machine, it is again quite smooth. I have tried on 3 other machines and its 50% good and bad. I have 3.5 SP1 installed on all the machines.

在系统中CPU的使用从不10%以上。我可以看到,我没有做任何软件渲染。我桌面上的视频卡了NVIDIA GeForce 7xxx系和波涛汹涌的机器之一是使用了NVIDIA GeForce 88XX卡。所有都使用相同的驱动释放和最currrent。屏幕清晰度一般为1920×1080,除了我的开发机是大得多(2560×1600)

CPU use on the systems never goes above 10%. I can see that I am not doing any software rendering. The Video card on my desktop is a nVidia Geforce 7xxx series, and one of the choppy machines was using a nVidia Geforce 88xx card. All are using the same driver release and the most currrent. Screen res usually is 1920x1080, with the exception of my Dev machine which is much larger ( 2560x1600)

但是 - 如果我用射孔来禁用脏区的支持 - 这是在所有机器上顺利,但现在CPU的30%

HOWEVER - if I use Perforator to DISABLE dirty region support - it is smooth on all machines but CPU is now at 30%

我很失落。该抖动现象几乎是像发条。有没有别的在有问题的机器怎么回事,所有测试的机器是酷睿2二重奏,大量的RAM,最新的驱动程序,最新的服务包,我只是不知道自己还能做些什么。我希望简单地提高CPU的使用,而不是落后。

I am lost. The choppiness is almost like clockwork. There is nothing else going on on the machines having the issues, all machines tested were Core 2 Duos, plenty of ram, latest drivers, latest Service Packs, I just dont know what else to do. I would expect simply higher CPU use, not lag.

推荐答案

如果您使用的是AllowsTransparency属性,您将拥有的性能和兼容性问题。

If you are using the AllowsTransparency property you will have performance and compatibility problems.

该技术的解释是在这里:

The technical explanation is here:

http://blogs.msdn.com/dwayneneed/archive/2008/09/08/transparent-windows-in-wpf.aspx

这是我个人的(痛苦)遇到一些显示器驱动程序将粉碎你的程序和其他人将让Windows工作不正常,当你有一个WPF透明窗口在屏幕上很长一段时间,我建议你尝试重新写你的GUI不使用的透明度。

from my personal (and painful) experience some display drivers will crush your program and others will make Windows work erratically when you have a WPF transparent window on screen for a long time, I recommend you try to re-write your GUI to not use transparency.

这篇关于奇怪的断断续续WPF动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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