简体   繁体   English

UITouch的所有CGPoints

[英]All CGPoints from UITouch

Consider the case of a single tap of a finger on a UIView . 考虑一下在UIView上轻按手指的情况。 I know you can get the CGPoint of the tap from the UITouch object, but is it possible to get all CGPoint s that were a part of the UITouch (ie all points under the finger)? 我知道您可以从UITouch对象获取水龙头的CGPoint ,但是是否有可能获得UITouch一部分的所有CGPoint (即手指下的所有点)? The touch screen hardware must be detecting all points of the screen where a conductive material is touching, but does Apple make it available? 触摸屏硬件必须能够检测屏幕上所有接触导电材料的点,但是Apple是否可以使用它?

What you get is not only the computed center of the touch (slightly corrected, because people tend to touch slightly below the point which they target), but also a variable called majorRadius . 您得到的不仅是计算出的触摸中心(略微校正,因为人们趋向于稍微触摸到他们所瞄准的点),还有一个称为majorRadius的变量。 In iOS8 this is given in increments of 10.45 mm, and the variable majorRadiusTolerance adds the variation of this measurement. 在iOS8中,此增量为10.45毫米,变量majorRadiusTolerance会添加此度量的变化。 Conveniently, in my measurements majorRadiusTolerance always came out as half the increment size, so a touch reported as 31.35 mm can be anywhere between 26.125 mm and 36.575 mm. 方便地,在我的测量中, majorRadiusTolerance始终是增量大小的一半,因此报告为31.35 mm的触摸可以在26.125 mm至36.575 mm之间的任何位置。 Of course, this is only an approximation, because non-round objects will still provoke the point and the radius, nothing more. 当然,这只是一个近似值,因为非圆形物体仍会引起点和半径,仅此而已。

I agree, more precision should be possible, but then where do you draw the boundary? 我同意,应该有更高的精度,但是那您在哪里划界呢? The capacitive signal wanes the more you move away from the center of the touch, and where it ends is an arbitrary decision in the end. 电容信号越远离触摸中心,它的衰减就越大,最终它是一个任意决定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM