QR Code detailed principle can refer to QR Wikipedia, the Chinese version introduction is relatively few, the English version introduction is very comprehensive, the recommendation looks English edition.
Description
The PHP QR Code is the Open source (LGPL) library for generating QR code, 2-dimensional barcode. Based on Libqrencode C Library, provides APIs for creating QR Code barcode Images (PNG, JPEG-to GD2). Implemented purely in PHP.
Features
supports QR Code versions (size) 1-40
numeric, alphanumeric, 8-bit and kanji encoding.
implemented purely in PHP, no external dependencies except GD2
exports to PNG, JPEG images, also exports as bit-table
tcpdf 2-d Barcode API Integration
Easy to configure
data cache for calculation speed-up
Debug data dump, error logging, Time benchmarking
provided merge tool helps deploy library as a one file
new! API Documentation
new! Over detailed examples
100% Open Source, LGPL licensed
Demo
Project Address: http://sourceforge.net/projects/phpqrcode/
Generate Fixed size images
* Phpqrcode itself does not provide a fixed size two-dimensional code settings, please refer to the http://sourceforge.net/p/phpqrcode/discussion/1111884/thread/f739531a/
code as follows |
  |
---original/phpqrcode/qrimage.php 2010-08-18 07:06:24.000000000-0700 +++ qrimage.php 2012-07-13 00:51:57.000000000-0700 @@ -86,10 +86,15 @@ } } - $target _image =imagecreate ($imgW * $ Pixelperpoint, $imgH * $pixelPerPoint); - imagecopyresized ($target _image, $base _ Image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); + + $targetW = (defined (' Image_width ')? ImaGe_width: $imgW * $pixelPerPoint); + $targetH = (defined (' Image_height ')? Image_height: $imgH * $pixelPerPoint); + + $target _image =imagecreate ($targetW , $targetH); + + imagecopyresized ($target _image, $ Base_image, 0, 0, 0, 0, $targetW, $targetH, $imgW, $imgH); Imagedestroy ($base _image); return $target _image; } - } No newline at end of file + } Use to set the generated two-dimensional code width to 500px Define (' Image_width ', 500); define (' Image_height ', 500); QRCode::p ng (' http://www.111cn.net/) '); |