是否有任何方法可以從使用手勢構建器創建的手勢庫中獲取手勢ID列表,然後將它們鏈接到存儲在數組中的圖像。 使用圖像添加到手勢疊加視圖,以便顯示。如何獲取手勢ID並鏈接到陣列中的圖像
我想將每個手勢鏈接到圖像,因此需要某種類型的ID或名稱。我已經看過樣本和其他在線材料avaialbe手勢,並沒有關於這個問題的信息。
任何幫助在這個問題將不勝感激。
例子:
//Link the images to the gesture ids, so when a user draws an "a", //it is linked to the gesture "a" if (sStore.load()) { for (String name : sStore.getGestureEntries()) { //Stores the gesture and its name into Gesture gesture for (Gesture gesture : sStore.getGestures(name)) { gesture.getID(); //link IDs to image_array[i] } } } //match the image and the gesture, after a touch event. if (predictions.size() > 0) { Prediction prediction = predictions.get(0); if(prediction.score > 1.0) { if(prediction.best_score == Current_Image) { Correct(); Next_image(); } } }
抱歉需要更多信息。你能鏈接到手勢庫的API嗎? – Blundell 2011-03-15 15:51:36
以下是鏈接信息: http://developer.android.com/reference/android/gesture/package-summary.html http://developer.android.com/resources/articles/gestures.html – Navigatron 2011-04-06 20:21:49