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

Qr code is not rendered #52

Open
MoaazElneshawy opened this issue Mar 14, 2022 · 1 comment
Open

Qr code is not rendered #52

MoaazElneshawy opened this issue Mar 14, 2022 · 1 comment

Comments

@MoaazElneshawy
Copy link

MoaazElneshawy commented Mar 14, 2022

I tried to use and it's generate the btimap , but when I scan the code no thing happens
here's my code

`
val logo = Logo()
logo.bitmap = BitmapFactory.decodeResource(context.resources, R.drawable.app_icon)
logo.borderRadius = 10 // radius for logo's corners
logo.borderWidth = 10 // width of the border to be added around the logo
logo.scale = 0.3f // scale for the logo in the QR code
logo.clippingRect = RectF(0f, 0f, 200f, 200f)

					val renderOption = RenderOption()
					renderOption.borderWidth = 20 // width of the empty space around the QR code
					renderOption.ecl = ErrorCorrectionLevel.M // (optional) specify an error correction level
					renderOption.patternScale = 0.35f
					renderOption.content = "www.google.com" // content to encode
					renderOption.size = 800 // size of the final QR code image
					renderOption.color = Color(
							auto = true,
							background = android.R.color.white,
							light = 0xFF0081D0.toInt(),
							dark = 0xFF0081D0.toInt(),
					) // set a color palette for the QR code
					renderOption.logo = logo

					try {
							val result = AwesomeQrRenderer.render(renderOption)
							if (result.bitmap != null) {
									// play with the bitmap
									findViewById<AppCompatImageView>(R.id.ivQrLogo)!!.setImageBitmap(result.bitmap)
							} else {
									// Oops, something gone wrong.
							}
					} catch (e: Exception) {
							e.printStackTrace()
					}

`

@nitzshe
Copy link

nitzshe commented Jul 28, 2024

It's rendered. But your scanner can't read it.
Try to use ErrorCorrectionLevel.H.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants