Android ZXING 通过 BitMatrix 编码 qr -->存储到 byte[] -->插入数据库

发布于 2024-12-12 12:29:26 字数 582 浏览 3 评论 0原文

周末我一直在玩zxing,遇到了一个我无法解决的问题。我正在使用工作java代码示例使用zxing进行QR码编码和解码,并且有兴趣将生成的 BitMatrix(包含二维码的位)转换为 byte[],以便我可以将图像存储在 sql lite blob 字段中(然后在需要时绘制条形码) 。有谁知道这是否可能。我不确定我提供的编码解决方案该去哪里。我查看了 http://zxing .org/w/docs/javadoc/com/google/zxing/client/j2se/MatrixToImageWriter.html 寻求解决方案,但尚未找到解决我的问题的任何方法(我想也许可以通过 !

非常感谢

MatrixToImageWriter

I have been playing around with zxing over the weekend, and have ran into a problem that I am unable to solve. I am using the working java code example at QR Code encoding and decoding using zxing, and am interested in converting the generated BitMatrix (that houses bits of the qr code) into a byte[] so that I can store the image in an sql lite blob field (and then draw the bar code when I want to). Does anyone know if this is possible. I am not sure where to go from the encoding solution that I have provided. I've looked at http://zxing.org/w/docs/javadoc/com/google/zxing/client/j2se/MatrixToImageWriter.html for a solution, but haven't found any fixes for my problem (I thought maybe accomplish this via MatrixToImageWriter.

Any help is greatly appreciated!

Cheers!

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

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

发布评论

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

评论(1

献世佛 2024-12-19 12:29:26

BitMatrix has several methods to get its contents, like get() which gets bit by bit or getRow() which gives you a row at a time as a BitArray. You can get the bits and do whatever you want.

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