IOS-Create a logo QR code

Source: Internet
Author: User

- (void) createlogoimage {Nsarray*filter =[Cifilter Filternamesincategory:kcicategorybuiltin]; NSLog (@"%@", filter); //Two-dimensional code filterCifilter *filterimage = [Cifilter filterwithname:@"Ciqrcodegenerator"]; //set the two-bit code filter as the default property[Filterimage SetDefaults]; //turn text into binaryNSData *dataimage = [@"Mafeng"datausingencoding:nsutf8stringencoding]; //Print the input propertiesNSLog (@"%@", Filterimage.inputkeys); //KVC Assignment Value[Filterimage setvalue:dataimage Forkey:@"InputMessage"]; //Remove the output imageCiimage *outputimage =[Filterimage Outputimage]; Outputimage= [Outputimage Imagebyapplyingtransform:cgaffinetransformmakescale ( -, -)]; //Convert PicturesUIImage *image =[UIImage Imagewithciimage:outputimage]; //Add a custom image to a two-dimensional code//open drawing, get picture context < picture size >Uigraphicsbeginimagecontext (image.size); //Picture The two-dimensional code .[Image Drawinrect:cgrectmake (0,0, Image.size.width, Image.size.height)]; //draw the small picture upUIImage *smallimage = [UIImage imagenamed:@"123.jpg"]; [Smallimage drawinrect:cgrectmake (Image.size.width- -) /2, (Image.size.width- -) /2, -, -)]; //get the final pictureUIImage *finalimage =Uigraphicsgetimagefromcurrentimagecontext (); //Close ContextUigraphicsendimagecontext (); //ShowSelf.imageview.image =Finalimage; }

IOS-Create a logo QR code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.