正文
]] placeholderImage:[UIImage imageNamed:@
"placeholderImage_square"
]];
successShareView.namedLb.text = [_userDic objectForKey:@
"name"
];
ZXMultiFormatWriter *writer = [[ZXMultiFormatWriter alloc] init];
ZXEncodeHints *hints = [ZXEncodeHints hints];
hints.encoding = NSUTF8StringEncoding;
hints.dataMatrixShape =ZXDataMatrixSymbolShapeHintForceSquare;
hints.margin = [NSNumber numberWithInt:0.];
hints.errorCorrectionLevel = [ZXQRCodeErrorCorrectionLevel errorCorrectionLevelH];
NSString *qrString = [_userDic objectForKey:@
"url"
];
ZXBitMatrix *result = [writer encode:qrString format:kBarcodeFormatQRCode width:500 height:500 hints:hints error:nil];
if
(result) {
CGImageRef image = [[ZXImage imageWithMatrix:result] cgimage];
UIImage *image1 = [UIImage imageWithCGImage:image];//二维码原图
UIImage *subIamge = [UIImage imageNamed:@
"新签到切图logo@2x-X"
];
__weak typeof(self) weakSelf = self;
successShareView.erweimaImageView.image =[weakSelf addSubImage:image1 sub:subIamge];//二维码里加图标,生成带logo的方法
// successShareView.erweimaImageView.image =image1;//生成不带logo的二维码的方法
}
else