Dimensions for four fault tolerant formats: 27, 31, 31, 35.
5, convert ciimage into uiimage, and enlarge display
UIImage *imagex = [UIImage imagewithciimage:outputimage];
NSLog (@ "%f", imagex.size.height);
Because the generated QR code is a CIImage , we switch directly to the UIImage size of the bad control, so use the following method to return the required size UIImage :
-(UIImage *) Createnoninterpolateduiimageformciimage: (Ciimage *) image withsize: (cgfloat) Size {cgrect extent = Cgrecti Ntegral (image.extent); CGFloat scale = MIN (Size/cgrectgetwidth (extent), size/cgrectgetheight (extent)); Create bitmap; size_t width = cgrectgetwidth (extent) * scale; size_t height = cgrectgetheight (extent) * scale; Cgcolorspaceref cs = Cgcolorspacecreatedevicegray (); Cgcontextref bitmapref = cgbitmapcontextcreate (nil, width, height, 8, 0, CS, (Cgbitmapinfo) kcgimagealphanone); Cicontext *context = [Cicontext Contextwithoptions:nil]; Cgimageref bitmapImage = [context createcgimage:image fromrect:extent]; Cgcontextsetinterpolationquality (Bitmapref, Kcginterpolationnone); CGCONTEXTSCALECTM (bitmapref, scale, scale); Cgcontextdrawimage (Bitmapref, extent, bitmapImage); Save bitmap to picture cgimageref Scaledimage = Cgbitmapcontextcreateimage (bitmapref); Cgcontextrelease (BITMAPREF); Cgimagerelease (BitmapImage); return [UIImage ImagewithCgimage:scaledimage];}
IOS qrcode default size and modifications