Generate a QR code at the backend.

Source: Internet
Author: User

Generate a QR code at the backend.

I recently found a relatively good C # QR code generation class library on github. I would like to share with you here.

Github address: https://github.com/codebude/QRCoder

Download the solution and compile and generate QRCoder. dll. This class library has few custom parameters and only supports two parameters (QR code text and Error Correction level ). If the image size is not properly controlled, a larger image can be generated. You can set the size of the image to be displayed on the front-end. (The two-dimensional code image is zoomed in and out, which generally does not affect the recognition degree .)

1 using QRCoder; 2 3 namespace QRCodeSample 4 {5 class Program 6 {7 static void Main (string [] args) 8 {9 var text = "http://www.baidu.com "; 10 var qrImage = "qr.jpg"; 11 12 var qrGenerator = new QRCodeGenerator (); 13 QRCodeGenerator. QRCode qrCode = qrGenerator. createQrCode (text, QRCodeGenerator. ECCLevel. q); 14 15 // you can modify this parameter to control the image size. 16 var image = qrCode. GetGraphic (20); 17 image. Save (qrImage); 18} 19} 20}

If you have better class libraries, do not share them.

Related Article

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.