I am doing a project with the QR Code. I want to change the color for each pixel.I tried but it doesn't work. Help me.
I tried: https://imgur.com/a/umE8xJ5
...
private int color_1 = 0x000000, color_2 = 0xffffffff, color_3 = Color.RED;
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if (bitMatrix.get(j, i)) {
if (j == 0) {
pixels[i * width + j] = color_3; // RED
} else {
pixels[i * width + j] = color_1; // BLACK
}
} else {
pixels[i * width + j] = color_2; // WHITE
}
}
}
...
I received: https://imgur.com/a/jJNrPqW
It seems that there is an existing QR code overlay.
Try setting red to 0x8F00. I think you encode the color as RGB-565, but Color.RED might be 24 bit, so there is an overflow.
User contributions licensed under CC BY-SA 3.0