iOS 7 Core Image QR Code generation too blur

前端 未结 8 1567
心在旅途
心在旅途 2020-12-24 02:44

here\'s my code for generating QRCode image

+ (UIImage *)generateQRCodeWithString:(NSString *)string {
    NSData *stringData = [string dataUsingEncoding:NSU         


        
8条回答
  •  借酒劲吻你
    2020-12-24 03:09

    I was about to start bounty on this question but i found the answer.

    What you need is a scale filter. To achieve this with CoreImage, you need to do something like this:

    CIImage *input = [CIImage imageWithCGImage: ImageView.Image.CGImage]; // input image is 100 X 100
    CGAffineTransform transform = CGAffineTransformMakeScale(5.0f, 5.0f); // Scale by 5 times along both dimensions
    CIImage *output = [input imageByApplyingTransform: transform];
    // output image is now 500 X 500
    

    FROM THIS SO ANSWER: https://stackoverflow.com/a/16316701/2859764

提交回复
热议问题