-
-
Notifications
You must be signed in to change notification settings - Fork 7
Support custom sized barcodes with transparent background #16
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
Conversation
simonsickle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple small things before a merge
| @Composable | ||
| fun Barcode( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not remove this until v2 please
| val offset = y * width | ||
| for (x in 0 until width) { | ||
| pixels[offset + x] = if (get(x, y)) android.graphics.Color.BLACK else android.graphics.Color.WHITE | ||
| pixels[offset + x] = if (get(x, y)) android.graphics.Color.BLACK else android.graphics.Color.TRANSPARENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
| val offset = y * width | ||
| for (x in 0 until width) { | ||
| pixels[offset + x] = if (get(x, y)) android.graphics.Color.BLACK else android.graphics.Color.WHITE | ||
| pixels[offset + x] = if (get(x, y)) android.graphics.Color.BLACK else android.graphics.Color.TRANSPARENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice to have the main color being passed from the barcode view and not be black all the time :)
|
Any plans to merge this? |
|
I've been working on V2 in the background which transitions over to more efficient drawing and uses the compose canvas (lets this work on compose desktop, for example) That said, I can merge this in the interim |
#13