We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
This a very nice work, but I have one question, it is possible to put a logo in the middle of the QR Code ?
Thank's in advance.
The text was updated successfully, but these errors were encountered:
I have the same question about add logo in qrcode.
Sorry, something went wrong.
It is possible by using UIGraphicsImageContext
UIGraphicsImageContext
private func generateQRCode(str: String) -> UIImage? { guard var qrCode = QRCode(str) else { return nil } qrCode.errorCorrection = .High guard let qrImage = qrCode.image, let logoImage = UIImage(named: "logo") else { return nil } let logoWidth = qrImage.size.width / 4 UIGraphicsBeginImageContextWithOptions(qrImage.size, false, 0) qrImage.draw(in: CGRect(origin: .zero, size: qrImage.size)) logoImage.draw(in: CGRect(x: (qrImage.size.width - logoWidth) / 2, y: (qrImage.size.width - logoWidth) / 2, width: logoWidth, height: logoWidth)) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image }
I don't know this is the best way. I want function to put image like QRCode#put(image: UIImage).
QRCode#put(image: UIImage)
No branches or pull requests
Hello,
This a very nice work, but I have one question, it is possible to put a logo in the middle of the QR Code ?
Thank's in advance.
The text was updated successfully, but these errors were encountered: