Two-dimensional code generation plug-in qrious

Time:2019-10-7

1.Qrious is a pure JS two-dimensional code generation plug-in based on canvas

1.1What is a two-dimensional code?

Two-Dimensional CodeQR CodeQRFull nameQuick ResponseIt is one of the most popular coding methods on mobile devices in recent years. It is more popular than traditional coding methods.Bar CodeBarcodes can store more information and represent more data types.

QR code/Two dimensional code2-dimensional bar code) It records data symbolic information with black-and-white graphics distributed in the plane (two-dimensional direction) according to certain rules of a specific geometric figure, and ingeniously utilizes the internal logic basis of the computer in coding.“0”“1”The concept of bit stream uses several geometric shapes corresponding to the binary system to represent the numeric information of text, and realizes the automatic processing of information through the automatic reading of image input devices or photoelectric scanning devices. It has some common features of barcode technology: each code system has its own specific character set; each character occupies a certain width; and has a certain check function. At the same time, it has the function of automatic recognition of information for different rows and processing of graphic rotation change points.

 

1.2Two-Dimensional Code Advantage

Large information capacity, Can accommodate up to1850Capital letters or2710A number or500Multiple Chinese characters

Wide range of applications, Support text,voice,picture,Fingerprints, etc.

Strong fault tolerance, Even if the picture is partially damaged, it can be used.

Low cost, Easy to make

1.3Fault Tolerance Level of Two-Dimensional Code

Level L(low) 7% The codeword can be restored.

MClass (middle) codeword15% It can be restored.

QGrade 4 codeword25% It can be restored.

HGrade (high) codeword30% It can be restored.

1.4Two-Dimensional Code Generation Plug-inqrious

qriousIt’s based onHTML5 CanvasPureJSTwo-dimensional code generation plug-in. adoptqrious.jsIt can quickly generate all kinds of two-dimensional codes. You can control the size and color of the two-dimensional codes. You can also generate two-dimensional codes.Base64Code.

qrious.jsThe available configuration parameters of the two-dimensional code plug-in are as follows:

parameter

type

Default value

describe

background

String

“white”

The background color of the two-dimensional code.

foreground

String

“black”

Foreground color of two-dimensional code.

level

String

“L”

Error Correction Level of Two-Dimensional Codes(L, M, Q, H)

mime

String

“image/png”

When the two-dimensional code is output as a pictureMIMEType.

size

Number

100

Two-dimensional code size, unit pixel.

value

String

“”

The value needed to be encoded as a two-dimensional code.

The following code generates a two-dimensional code

<span style="font-family: 宋体">Two-Dimensional Code</span><span style="font-family: Calibri">demo</span>

 var qr = new QRious({

   element:document.getElementById(‘qrious’),

   size:250,    level:’H’,    value:’https://www.baidu.com’

});

Operation effect:

Take out your cell phone and sweep it to see if you can see the front page of it.

 

Plug-in source code:

Link: https://pan.baidu.com/s/1xS6kanj1mK8kFET1JwyOLw
Extraction code: 5hes

 

If it fails, you can find me, comment on private letters will be seen!

Leave a compliment and go!