I'm seeking an open source QR codes image generator component in java (J2SE), but the open source licence mustn't be a GPL licence (needs to be included in a close source project).
我正在寻找java(J2SE)中的开源QR码图像生成器组件,但开源许可证不能是GPL许可证(需要包含在一个密切的源项目中)。
BTW, i can't access the web from the project so no Google API.
顺便说一句,我无法从项目访问网络,因此没有Google API。
3 个解决方案
#1
Mercer - no, there is an encoder in the library too. com.google.zxing.qrcode.encoder. We provide that in addition to an example web app using Google Chart APIs
美世 - 不,图书馆里也有编码器。 com.google.zxing.qrcode.encoder。除了使用Google Chart API的示例Web应用程序之外,我们还提供此功能
#2
ZXing is is an open-source, multi-format 1D/2D barcode image processing library implemented in Java. It is released under the The Apache License, so it allows use of the source code for the development of proprietary software as well as free and open source software.
ZXing是一个用Java实现的开源,多格式1D / 2D条形码图像处理库。它是在The Apache License下发布的,因此它允许使用源代码开发专有软件以及免费和开源软件。
#3
MatrixToImageWriter uses BitMatrix, not ByteMatrix as returned by QRCode.getMatrix. by looking at android sourcecode, I found the following proof of concept solution:
MatrixToImageWriter使用BitMatrix,而不是QRCode.getMatrix返回的ByteMatrix。通过查看android源代码,我发现了以下概念验证解决方案:
try {
MultiFormatWriter writer = new MultiFormatWriter();
Hashtable hints = new Hashtable();
hints.put( EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.Q );
MatrixToImageWriter.writeToFile( writer.encode( "hello world", BarcodeFormat.QR_CODE, 800, 800, hints ),
"png", new File( "/tmp/qrcode.png" ) );
} catch ( Exception e ) {
System.out.println( "failure: " + e );
}
btw imposing Hashtable in API is not clean. please use Map. not many people still use Hashtable anyway, you should almost always use HashMap instead (except a few use cases).
btw在API中强制使用Hashtable并不干净。请使用地图。无论如何,仍然没有多少人仍然使用Hashtable,你应该几乎总是使用HashMap(除了一些用例)。
#1
Mercer - no, there is an encoder in the library too. com.google.zxing.qrcode.encoder. We provide that in addition to an example web app using Google Chart APIs
美世 - 不,图书馆里也有编码器。 com.google.zxing.qrcode.encoder。除了使用Google Chart API的示例Web应用程序之外,我们还提供此功能
#2
ZXing is is an open-source, multi-format 1D/2D barcode image processing library implemented in Java. It is released under the The Apache License, so it allows use of the source code for the development of proprietary software as well as free and open source software.
ZXing是一个用Java实现的开源,多格式1D / 2D条形码图像处理库。它是在The Apache License下发布的,因此它允许使用源代码开发专有软件以及免费和开源软件。
#3
MatrixToImageWriter uses BitMatrix, not ByteMatrix as returned by QRCode.getMatrix. by looking at android sourcecode, I found the following proof of concept solution:
MatrixToImageWriter使用BitMatrix,而不是QRCode.getMatrix返回的ByteMatrix。通过查看android源代码,我发现了以下概念验证解决方案:
try {
MultiFormatWriter writer = new MultiFormatWriter();
Hashtable hints = new Hashtable();
hints.put( EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.Q );
MatrixToImageWriter.writeToFile( writer.encode( "hello world", BarcodeFormat.QR_CODE, 800, 800, hints ),
"png", new File( "/tmp/qrcode.png" ) );
} catch ( Exception e ) {
System.out.println( "failure: " + e );
}
btw imposing Hashtable in API is not clean. please use Map. not many people still use Hashtable anyway, you should almost always use HashMap instead (except a few use cases).
btw在API中强制使用Hashtable并不干净。请使用地图。无论如何,仍然没有多少人仍然使用Hashtable,你应该几乎总是使用HashMap(除了一些用例)。