有没有一种简单的方法来处理WPF4触摸事件,如弗里克? [英] Is there a simple way to handle Touch events like Flick in WPF4?

查看:211
本文介绍了有没有一种简单的方法来处理WPF4触摸事件,如弗里克?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个Windows 7的触摸应用程序,并希望能够处理触摸手势的简单事件,具体的笔触。我能看到的窗户响应,它弹出的图标,我挥一挥,但我似乎无法找到一个简单的方法来处理它们。喜欢的东西grid.OnLeftFlick ...

I'm building a windows 7 touch app and want to be able to handle touch gestures as simple events, specifically flicks. I can see windows responding, it pops up the icons as I flick but I can't seem to find an easy way to handle them. Something like grid.OnLeftFlick ...

我缺少的东西太简单?有没有一种工具或东西我可以使用?或者,我必须写我自己的听众?

Am I missing something stupidly simple? Is there a toolkit or something I can use? Or, do I have to write my own listener?

感谢。

推荐答案

虽然WPF4不支持多点触控,它不具有任何内置的手势支持,至少不是那种你都在思考。功能如一抖,捏缩放等,都对WPF4之上进行编程。

While WPF4 does support multi-touch, it does not have any built in gesture support, at least not of the kind you are thinking about. Features such as flick, pinch-zoom, etc. all have to be programmed on top of WPF4.

我不知道任何更高级别的手势支持工具包,但写你自己是不是很难,因为它的声音。这WPF4触摸样本显示例如基于触摸移动,捏变焦和捏旋转:

I don't know of any higher-level gesture support toolkits but writing your own is not as hard as it sounds. This WPF4 touch sample shows for example touch based move, pinch-zoom and pinch-rotate:

  • Walkthrough: Creating Your First Touch Application

如果你编译并运行你会看到处理程序的代码只有十到二十行样本,并利用强大的基础架构的触摸API本身和核心WPF的转换矩阵等功能。触摸API支持惯性等,所以尝试一下,以满足您的需求一抖。

If you compile and run the sample you'll see the handlers are only ten to twenty lines of code and make use of powerful infrastructure in the touch API itself and core WPF features such as transformation matrices. The touch API supports inertia, etc. so try your hand at a flick that meets your needs.

另外,当然,此示例仅适用于笔和触摸输入设备,而不是一个普通的鼠标,但你指定你正在开发一个应用程序的触摸

Also, of course, this sample only works with Pen and Touch input devices, not an ordinary mouse, but you specified that your are developing a touch application.

这篇关于有没有一种简单的方法来处理WPF4触摸事件,如弗里克?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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