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
QRCode appears small #46
Comments
Really have an issue with this and not enthused that it hasn't been acknowledged yet. Scaling it keeps it blurry and I can't see any way even with the native QR Code generation to get a large image. |
@cafuni I was able to get around this by adding a wrapper method that checks the type of barcode. If it is a QR Code, I use the following method:
Hopefully, the author will support something like this going forward in order to get a proper size and scale the CIImage appropriately. |
Have you tried to change the scale to larger value? self.imageDisplayed.image = RSAbstractCodeGenerator.resizeImage(image!, scale: 10.0) |
This works, but it only goes by scale. That's not as efficient when I'm trying to fill the bounds of something to the best capability and don't necessarily know what scale is too much to fill, or if the imageView itself is flexible. I ended up doing something like this:
Where I use the smallest of all the bounding lengths and the largest of the code image length since it should be a square. Any better way to achieve this? |
@bdrelling Your solution is great, I can provide one static function later to achieve this, one of the parameters should be contentMode (UIViewContentMode), what do you think? |
I've added one helper method to resize image, you may take a look @bdrelling @cafuni
|
@yeahdongcn I will take a look at this soon. Thanks for the response! |
Any ideas about the new resize method? @bdrelling @cafuni |
the QRCode appears very small...
let image: UIImage? = gen.generateCode(contents, machineReadableCodeObjectType: AVMetadataObjectTypeQRCode)
if let image = image {
self.barcodeView.image = RSAbstractCodeGenerator.resizeImage(image, scale: 1.0)
}
The text was updated successfully, but these errors were encountered: