首先,我阅读了所有这些主题,了解如何在Java中使用Zxing,但总是在com.google.zxing.client.j2se丢失时出错。 zxing core-3.2.1.jar在eclipse和所有其他zxing软件包工作除非j2se)或刚刚找到创建qr图像的解决方案...查找图像中的QR码并使用Zxing对其进行解码
我的目标是编写一个单一的方法,获取图像文件找到qr在此图像中码,解码QR码,并返回字符串,基本上就应该是这样的:
import com.google.zxing.*;
public class QRCode {
/*
* ...
*/
public String getDecodedString(SomeStandardImageType photo){
// detect the qr code in a photo
// create qr image from detected area in photo
// decode the new created qr image and return the string
return "This is the decoded dataString from the qr code in the photo";
}
}
综上所述方法应该得到的图像文件,如后续荷兰国际集团
,而应返回的URL,或者如果只是失败 “”。
该代码应该与Zxing 3.2.1兼容。
编辑:问题已解决。对于对此感兴趣的其他人,我想说,将外部罐子core-3.2.1.jar
和javase-3.2.1.jar
添加到外部罐子是很重要的。我的答案没有后者,但取决于Android图像库。
什么你的问题? –
问题是我怎样才能使用Zxing 3.2.1的算法;另一个方向显示在这里:http://crunchify.com/java-simple-qr-code-generator-example/ – Tim