开发者

How to calculate the diameter of the TouchPoint on an iPhone,iPad and Android Device?

Now i understand we can have 5 touch 开发者_Go百科points by default in iPhone and have varied touch points enabled onto the different SDKs. However i have accomplished registering the touch points and getting distances, actual number of touch points. I would want to know if there's a way to accomplish and get the Diameter of a particular touch point for e.g. calculating the thumb touch in comparison with the index finger, Any ideas?


I think Apple makes it fairly clear that they don't intend to give third-party developers access to low-level multi-touch information. From Apple's documentation on Event Handling in iOS:

A finger on the screen affords a much different level of precision than a mouse pointer. When a user touches the screen, the area of contact is actually elliptical and tends to be offset below the point where the user thinks he or she touched. This “contact patch” also varies in size and shape based on which finger is touching the screen, the size of the finger, the pressure of the finger on the screen, the orientation of the finger, and other factors. The underlying Multi-Touch system analyzes all of this information for you and computes a single touch point.


I can’t speak to Android, but the public APIs in the iOS SDK don’t give you any information about a touch other than its position. These guys found a private API (i.e. one that’ll get you rejected from the App Store if you use it) for getting the diameter of a touch on the screen, but they haven’t provided any further information or released the library.


It's likely possible on Android (4.3 I have, but most likely others too), as you can both activate an overlay display of touch properties in the Developer options as Pointer location (in Input category), which shows you coordinates, their Delta (=difference) and two properties you might be interested in: Prs, that is pressure and Size. It seems you can find the thresholds that would recognize a thumb and the index finger in most cases. That's just what I would imply from the values I have seen in that display.

A proof that this is possible within the allowed API is Yet Another MultiTouch Test Android App listed on on Google Play which for me shows the pressure of each touch in it's own interface (so it must be available in the standard API).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜