發表文章

目前顯示的是 12月, 2009的文章

Windows Mobile 6.5 Gestures (一)

圖片
在Windows Mobile 6.5中有提供了兩個新的功能,一個是Widgets,另外就是Gestures API了,今天就來測試看看Gestures的功能。由於Gestures是WM 6.5才有的功能,所以必須要有WM 6.5的模擬器來做測試,如果還沒有安裝過的話,可以到下面位置下載、安裝,請切記,要先安裝Windows Mobile 6 SDK,之後再安裝Windows Mobile 6.5 Developer Tool Kit,順序可不能顛倒喔。 Windows Mobile 6 Professional and Standard Software Development Kits Refresh Windows Mobile 6.5 Developer Tool Kit 接下來,下面是一些有關Gestures的相關參考資料 小歐的這篇-[Windows Mobile]Gestures API 擷取使用者的手勢 Windows Mobile Managed Gestures Sample 這邊可以下載到managed code需要的dll以及相關的sample,裡面也有兩個web cast,記得要看 How Do I: Use Windows Mobiles 6.5 Gestures in Managed Code? MSDN-Using Gestures in Windows Mobile 6.5 How to use the MSDN managed code gesture wrapper in a Windows Mobile 6.5 device project 在一些使用情境中,會有向右或是向左滑動就能夠切換頁面的功能,在以往WM6/6.1的時候,要做到這樣的功能,第一個遇到的問題就是必須要自行去辨識手勢的動作,必須要去掛hook,攔截滑鼠的點擊位置、放開的位置,之後去判斷方向等等,要做的事情滿多的,不是件簡單的事;而現在有了Gestures API之後,像這樣的功能做起來就方便的多了,接下來就來看看今天測試的程式碼了;首先要先加入Gestures dll的參考,加入後會多了像是下圖的name space可以使用 接下來是設計畫面,筆者這邊是用了3個panel來模擬切換畫面的動作,實際在執行的時候會分別去移動panel的位