专栏名称: 3033
iOS开发
目录
相关文章推荐
山西省应急管理厅  ·  历史上六月发生的危险化学品事故 ·  3 小时前  
鱼羊史记  ·  DeepSeek:普通人一生值得体验的十件事 ·  20 小时前  
江西晨报  ·  太原一地修路挖出“古城墙”!官方通报 ·  21 小时前  
江西晨报  ·  太原一地修路挖出“古城墙”!官方通报 ·  21 小时前  
全知识官方  ·  2025年高考语文试题评析 ·  1 周前  
51好读  ›  专栏  ›  3033

iOS生成带logo的二维码,区域截屏保存至相册(小功能二连发(一))

3033  · 掘金  ·  · 2017-12-14 00:35

正文

请到「今天看啥」查看全文


]] 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





请到「今天看啥」查看全文