在Windows中是否可以获得浮动触摸坐标? [英] Is it possible to obtain float touch coordinates in Windows?

查看:229
本文介绍了在Windows中是否可以获得浮动触摸坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我需要使用高精度输入坐标进行进一步计算。

I am working on a project in which I need to use high accuracy input coordinates for further calculation.

我打电话 GetTouchInputInfo 函数在WM_TOUCH消息处理程序中获取 PTOUCHINPUT 变量,但是此结构中提供的坐标以物理屏幕坐标的像素的百分之一表示。所以基本上最后2位数字总是0,除以100后,这些坐标只是整数屏幕坐标。我不知道他们为什么在百分之一。

I call GetTouchInputInfo function in WM_TOUCH message handler to acquire PTOUCHINPUT variables, but the coordinates provided in this struct are indicated in hundredths of a pixel of physical screen coordinates. So basically the last 2 digits are always 0, and after divided by 100, these coordinates are just integer screen coordinates. I don't know why did they make it in hundredth.

此外,触摸屏传感器是否提供连续信号,而不是谨慎的信号?我知道,在Window中有一个称为触摸预测的事情,它创建一个小的触摸输入滞后,因为它拥有几个最新的输入点,并做一些预测算法来修复这些新鲜的输入平滑和漂亮。即使触摸屏只能检测离散信号,输入应该在预测算法后浮动吗?

Besides, does the touchscreen sensor gives continuous signal instead of discreet signal? As I know, there is a thing called touch prediction in Window, it creates a small touch input lag as it holds a few latest input points and do some prediction algorithm to fix these fresh inputs smooth and pretty. Even if the touchscreen can only sense discreet signal, the input should be float anyway after the prediction algorithm right?

我真的找不到如何获得浮动触摸输入。有没有任何方式或任何功能来实现这一点?

I really couldn't find out how to obtain float touch input. Is there any way or any function to achieve this?

谢谢!

对不起我的英语。

推荐答案

将缩放的长坐标转换为float do:

To convert the scaled long coordinates to float do:

PTOUCHINPUT pt;
float xf = pt->x / 100.0;
float yf = pt->y / 100.0;

这篇关于在Windows中是否可以获得浮动触摸坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆