Sean,
It's good to know that at least it worked somehow. However, how to solve the problem?
I tried to change to write a JPG file, it gave me back a color file (Blue/Pink), but still couldn't be read by barcode scanner v3.31 on Android phone.
Is there any flag I should set? Maybe I should convert from ByteMatrix to BitMatrix before writing? I'm running my the test program on Vista, maybe related to big-endian, small-endian?
static void test() {
QRCodeWriter writer = new QRCodeWriter();
ByteMatrix matrix = null;
try {
matrix = writer.encode("
http://www.google.com/", BarcodeFormat.QR_CODE, 256, 256);
} catch (WriterException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (matrix != null) {
try {
File file = new File("test.png");
MatrixToImageWriter.writeToFile(matrix, "PNG", file);
System.out.println(file.getAbsolutePath());
}
catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
On Wed, Jul 28, 2010 at 10:09 AM, Sean Owen
<sro...@gmail.com> wrote:
This image is inverted. The QR code should be black on white, not
white on black. That is why it cannot be read.
On Wed, Jul 28, 2010 at 5:19 PM, Yue Liu <
george...@gmail.com> wrote:
> I have attached the generated file. Thanks for helping.
>