系统滤镜 生成二维码
//生成二维码图片
-(UIImage *)imageWithContent:(NSString *)content
{
//创建滤镜 二维码
CIFilter * filter =[CIFilter filterWithName:@"CIQRCodeGenerator"];
[filter setDefaults];
// 设置默认属性
// 将content转换成nsdata
NSData * data =[content dataUsingEncoding:NSUTF8StringEncoding];
[filter setValue:data forKey:@"inputMessage"];
[filter setValue:@"Q" forKey:@"inputCorrectionLevel"];
// 获得滤镜输出的图像
CIImage * outputImage =[filter outputImage];
// 然后把ciimage 转换成uiimage
return [self setSize:width_qr setCCImage:outputImage];