Android ZXING 通过 BitMatrix 编码 qr -->存储到 byte[] -->插入数据库
周末我一直在玩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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BitMatrix 有多种方法来获取其内容,例如
get()
逐位获取,或者getRow()
一次为您提供一行作为位数组
。你可以获得这些碎片并做任何你想做的事。BitMatrix has several methods to get its contents, like
get()
which gets bit by bit orgetRow()
which gives you a row at a time as aBitArray
. You can get the bits and do whatever you want.