画中的android单触式运动路径 [英] draw a single-touch motion path in android

查看:143
本文介绍了画中的android单触式运动路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使绘图应用程序。

我想为绘制一个单点触摸运动路径在Android的 - 像了Swype键盘做的方式。

i want to draw a single-touch motion path in android - like the way the Swype keyboard does it.

和因此我想为商店XY每个运动路径的像素的坐标转换为数据结构。

And consequently i want to store x-y coordinates of EACH of the pixels of the motion path into a data structure.

我怎么能使用MotionEvent指针做到这一点?

How can i use the MotionEvent pointers to do this?

推荐答案

您可能没有存储的每个像素 - 只存储一个新的当某些参数满足要求,如像素还沿着或者之间的夹角一个象素和下一大于一定的阈值。从你就会有一个更紧凑的多线,这将是更容易使用。

You probably don't have to store every pixel - just store a new one when certain parameters are met such as the pixel is further along or if the angle between one pixel and the next is greater than a certain threshold. From that you'll have a more compact poly line that will be easier to work with.

这篇关于画中的android单触式运动路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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