开发者

Silverlight MouseMove: find missing points during a movement

In an application in Silverlight I'm working on, I need to track the moves of the mouse. My problem is that using the MouseMove event, I don't have 开发者_高级运维a continuous set of points if the user moves the mouse fast enough (if I add each point in a list I can have (10,10) en then (20,20)...)

I'd like to have ALL points where the mouse has been during the move. Do you have any idea ?


This cannot work efficiently. The mousemove event of silverlight waits on the OS to send the signal with the coordinates to it. The operating system does not fire its event for every single point it moves, if it moves very fast. Most OS executes infinite loops, which checks for machine states, if these loops are fast, then it will probably pick up the mousemove for every point. If the mouse moves from (1,1) to (20,20) in 0.001ms, the OS will probably call the event at (10,10) or it will not at all if the loop does not hit it on time.

A way you can possibly speed this up is lessen the codes in your mousemove or make them async.

Another way is a mathematical way, to calculate the path based on what you have already collected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜