Android XML 中有触摸输入吗?
是否可以创建一个触摸绘图区域来在表单中签名?
我正在开发一个通过表单收集信息的应用程序,并希望通过让应用程序的用户在屏幕上绘制签名来收集签名。我将如何为 Android 做到这一点。我最好希望将“签名”存储为图像以保存在某处。
有人知道吗?
非常感谢,
Is it possible to create a touch draw area to take signatures in a form?
I am working on an application to collect information though a form and would like to collect signatures by letting users of the app draw a signature on the screen. How would I do this for android. Preferably I would like the "signature" stored as a image to save somewhere.
Does anyone have any idea?
Many thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 Google 的 Fingerpaint API 示例——完整的应用程序包含在示例中——但主 Java 文件的代码是 此处。
基本上,将视图的一小部分作为画布控件(如手指画),然后当用户按下“完成”时,将
Canvas
保存为图像(使用Bitmmap
附加到Canvas
的对象。)您可能想要关闭此特定视图的旋转,否则当您旋转图像时签名将被清除 - 除非您实现某种旋转图像的方法。
Check out Google's API example of Fingerpaint -- the full app is included in the samples -- but the code to the main Java file is here.
Basically, make some small section of the view a canvas control (like in finger paint) and then when the user presses done, save the
Canvas
as an image (using theBitmmap
object attached to theCanvas
.)You may want to turn rotation off for this particular view, otherwise the signature will get cleared when you rotate the image -- unless you implement some way of rotating it.