4 ways to generate two-dimensional code (JS control canvas to draw a two-dimensional code)

Source: Internet
Author: User

With the rapid development and development of the network, the application of QR code will be more and more. At the same time a lot of just a very ordinary two-dimensional code, please pick up your hand to the two-dimensional code design it up. Here are a few very good QR code designs to share.

   Two-dimensional code principle:  two-dimensional barcode/Two-D code can be divided into stacked/row-type two-dimensional barcode and matrix two-dimensional barcode. Stacked/row-type two-dimensional barcode form is composed of a multi-line short-cut one-dimensional 5 code stack; matrix two-dimensional bar code in the form of a matrix, the corresponding elements of the matrix with a "point" for the binary "1", with "empty" means binary "0", "point" and "empty" arrangement of the code.   recently developed an interest in QR codes. The terms generated in the QR code qrcode   fault tolerance is higher.   Data representation The Dark module represents the binary "1" and the light module represents the binary "0". Error correction capability · L-Class: About 7% data code words can be corrected · M-Class: About 15% data code words can be corrected · Q-level: About 25% Data code words can be corrected · H: About 30% Data code word      The above design is a perfect use of qrcode fault tolerance, very nice   also very creative!!  1.google interface  <?php                $urlToEncode = "/http" Www.csd2n.net ";//to generate QR code URLs                generateqrfromgoogle ($urlToEncode); nbsp              function generateqrfromgoogle ($chl, $widhtHeight = ' Max ', $EC _level= ' L ', $ margin= ' 0 ')                {                $url = UrlEncode ($url);               echo ' ';//google API interface, if it is not valid to Google URL query the latest interface                }      &NB Sp        ?>  2..js code conversion to canvas (focus) Demo:http://hxend.com/jsqrcode/test/ <script Type= "Text/javascript" src= "Http://sandbox.runjs.cn/uploads/rs/142/gjxgxu0g/qrgen.min.js" ></script>                <div id=qrcode></div>               <script type= "Text/javascript" >               qrcode (d Ocument.getelementbyid (' QRCode '),{                   data: '/HTTP// Geraldl.net '                });              &NB Sp;</script>  3. Picture interface    4.demo inside Http://hxend.com/jsqrcode/test /Code  <!doctype&NBSP;HTML>

4 ways to generate two-dimensional code (JS control canvas to draw a two-dimensional code)

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.