Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 895
mlemay Avatar asked Jan 13 '12 20:01

mlemay


2 Answers

This seems to be a bug. Take a look at this post.

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/756a2ccf-6cf1-4e4a-a101-30b6f3d9c2c9/#ed51226a-6319-49f8-be45-cf5ff48d56bb

Or

http://www.codeproject.com/Articles/692286/WPF-and-multi-touch

like image 53
Andreas Avatar answered Sep 24 '22 15:09

Andreas


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.

like image 40
Ivan Yuriev Avatar answered Sep 25 '22 15:09

Ivan Yuriev