简体   繁体   中英

Application, improve performance of touch events

Basically, I have an application witch is 8000px by 8000px. We can zoom in to view a specific part, example on the radio, or we can zoom out to view everything.

Each part of the car is a control that we can manipulate with fingers, on a dual touch or multitouch monitor.

My problem is: for manipulating a control, for example the Volume button, the user needs to move the mouse exactly like in real life, so with a circular movement. With the mouse everything is perfect, it responds instantly without any delay. I use the OnMouseLeftButtonDown, OnMouseMove, etc. With the touch, it seems to be very difficult for the computer to get the touch position and there is a huge lag, especially when the user move 2 different button with 2 fingers at the same time. I use the OnTouchDown, OnTouchMove, etc...

The only difference between the mouse and the touch is when we need to get the position, with the Mouse I use: (e is a MouseButtonEventArgs)

Point currentPosition = e.GetPosition(this);

With the Touch I use: (e is a TouchEventArgs)

Point currentPosition = e.GetTouchPoint(this).Position;

Everything after this is the same.

I don't know if it's because I have too many control in the my application (over 5000 that we can manipulate, but when we zoom in on only 2 control it's the same thing) or because it is really difficult for the computer to get the position from a touch event....

Can someone help me with this? I need to find a solution to eliminate the lag.

I use Visual Studio 2010, Blend 4, .NET 4.0 Windows 7 64-bit 7 Gb RAM Xeon 2.13 Ghz, 2 core, 8 thread Screen: ELO technology, in a NEC 2490WUXi2 screen

it's hard to say why you have such an issue - may be OnTouchMove is triggered more often than MouseMove and you should create some additional processing to smooth the touch positions data. I'd try to comment all the code under the Point currentPosition = e.GetTouchPoint(this).Position;

and look at the performance.

Another approach is to count how much OnTouchMove is triggered.

问题是触摸设备,尝试另一个,看看滞后是否仍然存在。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM