1. Use zxint.net to generate a QR code with logo
/// <summary>///Create a QR code with logo/// </summary>/// <param name= "text" ></param>Static voidGenerate3 (stringtext) { //Logo ImageBitmap logo =NewBitmap (@"h:\ Desktop \\102.jpg"); //construction of two-dimensional code write code deviceMultiformatwriter writer =NewMultiformatwriter (); Dictionary<encodehinttype,Object> hint =NewDictionary<encodehinttype,Object>(); Hint. ADD (Encodehinttype.character_set,"UTF-8"); Hint. ADD (encodehinttype.error_correction,errorcorrectionlevel.h); //generate two-dimensional codeBitmatrix BM = Writer.encode (Text,barcodeformat.qr_code, -, -, hint); Barcodewriter Barcodewriter=NewBarcodewriter (); Bitmap Map=Barcodewriter.write (BM); //get the actual size of the QR code (remove the actual size after the two-dimensional code is blank) int[] Rectangle =Bm.getenclosingrectangle (); //calculate the size and position of the inserted picture intMiddlew = Math.min ((int) (rectangle[2] /3.5), logo. Width); intMiddleh = Math.min ((int) (rectangle[3]/3.5), logo. Height); intMiddlel = (map. Width-middlew)/2; intMiddlet = (map. Height-middleh)/2; //convert img to BMP format, otherwise the graphics object cannot be created laterBitmap bmpimg =NewBitmap (map. Width,map. HEIGHT,PIXELFORMAT.FORMAT32BPPARGB); using(Graphics g=graphics.fromimage (bmpimg)) {G.interpolationmode=System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; G.smoothingmode=System.Drawing.Drawing2D.SmoothingMode.HighQuality; G.compositingquality=System.Drawing.Drawing2D.CompositingQuality.HighQuality; G.drawimage (Map,0,0); } //Insert the QR code into the pictureGraphics mygraphic =graphics.fromimage (BMPIMG); //White backgroundMygraphic.fillrectangle (Brushes.white,middlel,middlet,middlew,middleh); Mygraphic.drawimage (Logo,middlel,middlet,middlew,middleh); //Save as PictureBmpimg. Save (@"h:\ Desktop \\generate3.png", imageformat.png);}
Call:
// Create a QR code with a picture Generate3 ("https://www.baidu.com/"); Generate3 ("Ionic is a powerful hybrid/hybrid HTML5 Mobile development Framework characterized by the use of standard HTML, CSS, and JavaScript to develop cross-platform applications, Just a few steps to quickly create your Ionic app and create an app from here ");
C # zxing.net generates two-dimensional code, identifies two-dimensional code, and generates a two-dimensional code with a logo (ii)