views:

1303

answers:

3

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.

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 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)

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

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.

+2  A: 

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

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.

Nir
A: 

I am having a very similar issue with a program I recently created using the WPF. It works fine on the build machine I am using which is running windows server 2003, but when I switch it to an XP machine with more than sufficient resources to run the program, it becomes extremely choppy. Basically it gets one frame per second. Every tick the animation will move along. I have heard of this problem where it goes away after the animation completes one cycle (through the animation) but for me it stays like this forever.

And I am not using the AllowsTransparency property, so if anyone else has any ideas I would very much appreciate it.

(the machine its failing on is also a Core 2 Duo)

Thanks, Eric

A: 

Ok, I just solved the problem after posting my previous statements. It turns out I hadnt installed my graphic drivers on this computer yet, and after I did it started working very smoothly. Perhaps it was using some software graphics rendering previously or something. So I recommend you update your graphics drivers to the most recent available to see if this helps the problem. The original poster seems to be having a different issue however, since it seems he has his fx drivers properly installed. I am not sure if there are any problems with nvidia 8800 cards with directx though.

Thanks, Eric