Two-dimensional code generation Zxing.net DEMO

Source: Internet
Author: User

Zxing.net is an open source project maintained by Google. Used to generate QR codes on the. NET platform, and of course there are many other uses.

Install commands with NuGet

Install-package zxing.net

Then add the namespace:

using ZXing; using Zxing.common; using zxing.rendering;

Generate a link to the address of the demo, the demo of the Baidu link to the address you want any character content can be.

   Static voidMain (string[] args) {Barcodewriter Barcodewriter=NewBarcodewriter (); Barcodewriter.format=Barcodeformat.qr_code; Barcodewritergeneric<Bitmap> Arg_50_0 =Barcodewriter;            Encodingoptions arg_50_1; Arg_50_1=Newencodingoptions {Height= -, Width= -            }; Arg_50_0.options=arg_50_1; Barcodewriter writer=Barcodewriter; varBitmap = writer. Write ("http://www.baidu.com"); Bitmap. Save ("Qr-code.png", System.Drawing.Imaging.ImageFormat.Png); }

This is a console program, under the Bin/debug can be found qr-code.png this generated QR code.

The generated Baidu home QR code is as follows:

With your sweep, you can open Baidu.

Two-dimensional code generation Zxing.net DEMO

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.