在触摸事件中如何获取所有激活的像素?
我不知道是否可以使用 Objective-C,但我想找到在触摸事件中已敏感的所有像素/点。
例如,如果我用拇指触摸屏幕,那么我将“激活”某些像素。如果我使用笔做同样的事情,那么我应该激活更少的像素。
有没有办法检索这些像素的坐标?
I don't know if it is possible using Objective-C, but I would like to find all the pixels/points that have been sensibilized in a touch event.
For example, if I use my thumb to touch the screen, then I will 'activate' certain pixels. If I use a pen to do the same thing, then I should get fewer pixels activated.
Is there a way to retrieve the coordinates of these pixels?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前 SDK 不支持此功能(我实际上提交了针对相同功能的请求)。
十一设计创建了一个框架并对其进行了演示:http://www.macrumors.com/2010/07/01/Pressure-sensitive-sketching-on-ipad-demoed/
不幸的是,他们使用了私有 API,并且尚未发布向公众公开(尽管对于发行版构建来说它仍然没有多大价值)。
This is currently not supported in the SDK (I actually submitted a request for the very same feature).
Ten One Design created a framework and demo'd it: http://www.macrumors.com/2010/07/01/pressure-sensitive-sketching-on-ipad-demoed/
Unfortunately, they used private APIs, and have yet to release it to the public (although it would still not be very valuable for a distribution build).
记住触摸检测在 iOS 中的工作原理很重要,硬件和抽象层必须检测触摸的确切大小,以便计算出触摸实际触摸的内容,iOS 内部只是检查堆栈中最高的响应者中的哪一个其范围内的触摸。如果它处理触摸,它将从那里开始并使用第一个作为响应者。
这完全是猜测,但也许你可以在 iOS 中设置一个透明的伪网格视图,并检测哪些网格单元在触摸范围内???只是一个想法,也许充满了性能问题,但也许是一个开始..?
its important to remember how touch detection works in iOS, the hardware and abstraction layer must detect the exact size of the touch in order to work out what the touch actually touches, iOS internally just checks to see which of the responders highest up the stack has the touch within its bounds. if it handles the touch, it goes from there and uses the first one as the responder.
this is total speculation but maybe you could set up a pseudo grid view in iOS that is transparent and detect which of your grid cells are within the touch ??? just an idea, and maybe fraught with performance issues but maybe a start ..?