Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate QR Code with Colors for each Pixel? #1164

Closed
MynamesHai opened this issue May 4, 2019 · 0 comments
Closed

How to generate QR Code with Colors for each Pixel? #1164

MynamesHai opened this issue May 4, 2019 · 0 comments

Comments

@MynamesHai
Copy link

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.

...

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:
V1PO7BG

@srowen srowen closed this as completed May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants