在触摸事件中如何获取所有激活的像素?

发布于 2024-11-09 20:00:26 字数 138 浏览 0 评论 0原文

我不知道是否可以使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

記憶穿過時間隧道 2024-11-16 20:00:26

目前 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).

We plan to release this capability as
a free software library so it can be
included in any application. However,
this may not be possible for a while
as the library now uses a private
function call to access the required
information.

嘿嘿嘿 2024-11-16 20:00:26

记住触摸检测在 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 ..?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文