Generate QR code method summary_javascript skills

Source: Internet
Author: User
This article mainly summarizes the information about the QR code generation method. For more information, see the rapid development of the network. At the same time, there are many simple QR codes. Please pick up your hand and design the QR code. Below I will share some excellent QR code designs.

QR code principles:

Two-dimensional Barcode/two-dimensional Barcode can be divided into stacked/row-layout two-dimensional barcode and matrix two-dimensional barcode. Stacked/row-lined two-dimensional bar codes are stacked by one-dimensional five-bar codes with multiple lines of short cut; matrix two-dimensional bar codes are composed of matrices, in the corresponding element position of the matrix, "point" indicates the binary "1", and "null" indicates the binary "0", "point" and "null" to form the code.

Recently, I am interested in the QR code. I have studied the term qrcode, which is highly fault-tolerant.

Data Representation

The dark color module indicates the binary "1", and the light color module indicates the binary "0 ".
Error correction capability
· L-level: about 7% of data code words can be corrected.
· M-level: 15% of data code words can be corrected
· Q level: About 25% of data code words can be corrected
· Level H: about 30% of data code words can be corrected

The above design perfectly utilizes the fault tolerance of qrcode. It is nice and creative !!

1. google Interface

The Code is as follows:


<? Php
$ UrlToEncode = "http://www.csd2n.net"; // URL of the QR code to be generated
GenerateQRfromGoogle ($ urlToEncode );
Function generateQRfromGoogle ($ chlorophyll, $ widhtHeight = '000000', $ EC_level = 'l', $ margin = '0 ')
{
$ Url = urlencode ($ url );
Echo ''; // The Google API. If the API fails, you can query the latest API on the Google website.
}
?>

  

2. Convert. js code to canvas (important)

Demo: http://hxend.com/jsqrcode/test/

The Code is as follows:









QR code generation


Image:Clear edge



Text:Http://www.btgoogle.com </textarea> </p>

Size:












Effect:
Liquid Square Circle


Foreground color:
Background color:

Outside-border color:
Inside-border color:


Generate





The above four methods are the simplest of the 3rd, and the second one is recommended by me, with a higher degree of freedom. Let's choose one based on your needs.

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.