在 Android 2.x 上捕获矢量格式的签名

发布于 2024-12-26 03:55:27 字数 219 浏览 3 评论 0原文

我正在编写一个需要以矢量格式捕获用户签名的应用程序。在 iOS 上,我使用 SVG 元素进行绘制,然后将该 SVG 矢量转换为我需要的矢量格式。 现在我需要在 Android 2.x 中执行此操作。问题是 Android 仅支持画布绘图。

无论如何,有没有办法跟踪用户在画布上绘图,以便我获得矢量格式?由于画布创建光栅图像,我无法将其转换为矢量。

任何想法都会有帮助。

谢谢

I am writing an app that needs to capture a users signature in a vector format. On iOS I am using an SVG element to draw to then converting that SVG vector into the vector format I need.
Now I need to do this in Android 2.x. The issue with this is that Android only supports the canvas for drawing.

Is there anyway to trace the user drawing on the canvas so that I get a vector format? Since the canvas creates a raster image I can't convert it to a vector.

Any ideas would be helpful.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

疏忽 2025-01-02 03:55:27

我不相信这是直接支持的。我认为最好的选择是继承 android.graphics.Path 并覆盖 moveTo(int, int)lineTo(int, int),存储这些事件后,您可以创建一个 toSvgPathString() 并获取您需要的“M x,y L x,yx,yx,y ..”字符串。

I don't believe this is supported directly. I think your best bet is to subclass android.graphics.Path and override moveTo(int, int) and lineTo(int, int), after storing these events you could then create a toSvgPathString() and get the "M x,y L x,y x,y x,y .." string you need.

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