Requirement: The program prepares several QR codes for the public account. The total amount is RMB. scan the QR codes to receive the QR codes. each QR code must receive a red envelope. you cannot receive the QR codes again after r
Thinkphp3.2.3 integrate phpqrcode to generate QR code with logo and qrcode QR code logo
Thinkphp does not contain libraries related to QR codes. Therefore, we can integrate phpqrcode to generate QR codes.
Download phpqrcode
: Http
($ data, $ filename, $ errorCorrectionLevel, $ matrixPointSize, $ margin );
[1] php qr Code supports png, jpg, svg, text, and other formats, starting with QRcode: svg.
[2] $ data: indicates the data to be recorded. A maximum of 984 UTF-8 encoded Chinese characters can be stored.
[3] $ filename: name of the saved Image
[4] $ errorCorrectionLevel: Error Correction level (L, M, Q, H). The
Php generates a QR code and a QR code with a logo in the middle. No one knows me when I wrote a QR code two years ago. Later, there were more apps scanning QR codes on mobile phones, wh
look at its encoding process.
Qrcode structure:
Figure 9 Structure of qrcode
Represents the character area of the QR code:
Figure 10 character area distribution of 2-M characters in version 10
Figure 11 symbol character layout of the 7-H symbol
We can see from the above that there are error correction blocks and data blocks in the character area distribution.
Let's look at the coding process:
Step 1 Da
No one knows me when I wrote a QR code two years ago. Later, there were more apps scanning QR codes on mobile phones, which changed the times. Thanks to smartphones and. The QR code is a two-dimensional bar code... SyntaxHighlight
-bri to adjust the brightness of the picture, and the remaining usage and value are the same as-con.Dynamic GIF Two-dimensional codeIf you want to generate a dynamic GIF QR code, the way with the above image of the two-dimensional code generation is no different, just convert the original png/.jpg picture into GIF.Get
, problems may occur.
// NO content will be found after scanning
// Here we can see the method of parsing the QR code
//-------------------------------------------------
// 3. The test \ n can be identified by the QR code
// There is also a reason, because after scanning the QR
Jquery generates the QR code. jquery generates the QR code.
Go to the topic:
Introduce jquery js and jquery-qrcode.js. I will upload the code demo to the resource library later. The code is simple:
It is easier to generate a
, Self.imageLine.frame.size.width, Self.imageLine.frame.size.height);if (Linevalue ==minvalue) {down = YES;up = NO;}}}/** This is the proxy method that must be implemented, and from this method you can get the scanned url*/#pragma mark-avcapturemetadataoutputobjectsdelegate-(void) Captureoutput: (Avcaptureoutput *) captureoutput didoutputmetadataobjects: (Nsarray *) metadataobjects Fromconnection: (avcaptureconnection *) connection{NSString * STRINGVA
not distinguish between data types.
3. the business card QR code uses vCARD encoding rules. The format is similar
BEGIN: VCARDVERSION: 3.0N: name of a companyTEL; WORK: 12345667EMAIL; WORK: abcd@abcd.comADR; WORK: A string of address informationURL: http://www.xxxxxx.comEND: VCARD
4vCARD main concepts.
Starting from BEGIN: VARD, ending from END: VARD
Contains VERSION information. The keyword is VERSION. VE
Generate a QR code and a QR code with Parameters
This article describes a jquery-based QR code generation plug-in qrcode. You can call this plug-in on the page to generate the corresponding QR
Learn the QR code of iOS, and quickly open the camera to read the QR code.
The procedure is as follows:To read the QR code, you must import it to the AVFoundation framework.#import 1: use the camera to identify the content in the
modules.Data and Error correction code word: The actual saved QR code information, and error correction code word (for correcting the errors caused by the two-dimensional code corruption).encoding process of QR codeHere is a brie
: fault tolerance level (divided into four levels, L-default: 7% of lost data can be identified; M-can identify 15% of lost data; q-can identify 25% of data loss; H-can identify 30% of data loss)
Margin: The distance between the generated QR code and the image border.
Example 1: Scan the QR code to open the
Implementation of a simple case and parameter descriptionCase Description:QRCode::p ng ($data, $filename, $errorCorrectionLevel, $matrixPointSize, $margin);[1] PHP QR code supports PNG, JPG, SVG, text and other formats, using the same format as Qrcode::svg.[2] $data: Represents the data to be recorded, if it is stored utf-8 encoded in Chinese, a maximum of 984.[3] $filename: Saved picture name[4] $errorCor
Do not do too much description, the detailed content can refer to the article "Thinkphp3.2 version combined with Phpqrcode to generate two-dimensional code and provide download."The method is to replace the QRCode () method with the QICODE_MH () method, and the path can be configured by itself.Generate QR code-beautify version public function qrcode_mh ($
========================================================== ======= PHP usage ====================================== ==============================1. Use google to open APIs[Php]$ UrlToEncode = "name: Liu xinming, phone: 18792448443 ";GenerateQRfromGoogle ($ urlToEncode );/*** Google api QR code generation [QRcode can store any text of a maximum of 4296 letters/numbers. For details, see the
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.