{"id":2140,"date":"2018-11-08T03:40:09","date_gmt":"2018-11-07T18:40:09","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2140"},"modified":"2020-05-22T04:41:52","modified_gmt":"2020-05-21T19:41:52","slug":"python-php-javascript%e3%81%a7qr%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e3%81%a4%e3%81%8f%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86%ef%bc%81","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2140","title":{"rendered":"Python, PHP, JavaScript\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u3063\u3066\u307f\u3088\u3046\uff01"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u6700\u8fd1\u3067\u306f\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306f\u30db\u30f3\u30c8\u306b\u4e00\u822c\u7684\u306b\u306a\u3063\u3066\u3001\u4eca\u3067\u306f\u307b\u3068\u3093\u3069\u306e\u4eba\u304c\u5f53\u305f\u308a\u524d\u306e\u3088\u3046\u306b\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u6301\u305f\u306a\u3044\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306e\u305f\u3081\u5165\u529b\u306e\u88dc\u52a9\u6a5f\u80fd\u3068\u3057\u3066\u3053\u3061\u3089\u3082\u4e00\u822c\u7684\u306b\u306a\u3063\u305f\u306e\u304cQR\u30b3\u30fc\u30c9\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3042\u308b\u6642\u3075\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>QR\u30b3\u30fc\u30c9\u3092\u79c1\u304c\u30e1\u30a4\u30f3\u3067\u4f7f\u3063\u3066\u3044\u308bPyhon\u3001PHP\u3001JavaScript\u3067\u3064\u304f\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3060\u308d\u3046\u304b\uff1f\u3068\u3002<\/p>\n<p>\u3068\u3046\u3053\u3068\u3067\u3001\u51fa\u767a\u5730\u70b9\u306f\u500b\u4eba\u7684\u306a\u7406\u7531\u304b\u3089\u3067\u3059\u304c\u3001\u4eca\u306e\u958b\u767a\u696d\u52d9\u3067\u3082\u305f\u307e\u306bQR\u30b3\u30fc\u30c9\u306f\u3054\u8981\u671b\u3068\u3057\u3066\u3044\u305f\u3060\u304f\u306e\u3067\u3001\u4eca\u56de\u306f\u8a00\u8a9e\u306e\u533a\u5225\u3092\u305b\u305a\u3001\u305d\u308c\u305e\u308c\u306eQR\u30b3\u30fc\u30c9\u306e\u4f5c\u308a\u65b9\u3092\u307e\u3068\u3081\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u958b\u767a\u306e\u53c2\u8003\u306b\u306a\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-427 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/24.png\" alt=\"\" width=\"182\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/24.png 182w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/24-171x300.png 171w\" sizes=\"auto, (max-width: 182px) 100vw, 182px\" \/><\/p>\n<h1>Python\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h1>\n<p>\u958b\u767a\u74b0\u5883\uff1a python 2.7<\/p>\n<p>Python \u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b\u306b\u306f\u305d\u306e\u540d\u524d\u306e\u307e\u307e<a href=\"https:\/\/pypi.org\/project\/qrcode\/\" target=\"_blank\" rel=\"noopener noreferrer\">qrcode<\/a>\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3046\u3068\u4fbf\u5229\u3067\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u307e\u305a\u306f\u3053\u306e<code>qrcode<\/code>\u3092<code>pip<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>pip install qrcode<\/strong><\/pre>\n<p><code>pip list<\/code> \u3092\u5b9f\u884c\u3057\u3066qrcode\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2141\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pip_qrcode.png\" alt=\"\" width=\"734\" height=\"414\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pip_qrcode.png 734w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pip_qrcode-300x169.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<h2>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n<pre><strong>import qrcode<\/strong>\r\n\r\ntext = 'http:\/\/example.com'\r\n<strong>img = qrcode.make(text);<\/strong>\r\n\r\nimg.save('qrcode_1.png')<\/pre>\n<p>\u307e\u305a <code>qrcode<\/code>\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3001<code>make()<\/code>\u3092\u4f7f\u3063\u3066QR\u30b3\u30fc\u30c9\u306e\u753b\u50cf\u3092\u3064\u304f\u308a\u307e\u3059\u3002\u4f5c\u6210\u3055\u308c\u305f\u753b\u50cf\u306f<code>pillow<\/code>\u306e\u753b\u50cf\u30c7\u30fc\u30bf\u306a\u306e\u3067<code>save()<\/code>\u3067\u3053\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u4fdd\u5b58\u3055\u308c\u305fQR\u30b3\u30fc\u30c9\u304c\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2142\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1.png\" alt=\"\" width=\"330\" height=\"330\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1.png 330w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-100x100.png 100w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/p>\n<h2>\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p><code>qrcode<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3001\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>import qrcode\r\n\r\ntext = 'http:\/\/example.com'\r\nqr = qrcode.QRCode(\r\n    <strong>version<\/strong>=1,\r\n    <strong>error_correction<\/strong>=qrcode.constants.ERROR_CORRECT_L,\r\n    <strong>box_size<\/strong>=5,\r\n    <strong>border<\/strong>=4,\r\n)\r\nqr.add_data(text)\r\nqr.make()\r\n\r\nimg = qr.make_image(<strong>fill_color<\/strong>=\"brown\", <strong>back_color<\/strong>=\"pink\")\r\n\r\nimg.save('qrcode_2.png')\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u305fQR\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2143\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2.png\" alt=\"\" width=\"165\" height=\"165\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2.png 165w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2-100x100.png 100w\" sizes=\"auto, (max-width: 165px) 100vw, 165px\" \/><\/p>\n<p>\u3067\u306f\u5404\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3072\u3068\u3064\u305a\u3064\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>version<\/h3>\n<p>\u30bb\u30eb\u306e\u500b\u6570\u3002<code>1<\/code>\u301c<code>40<\/code>\u3002<br \/>\n\u5bfe\u5fdc\u3059\u308b\u30bb\u30eb\u6570\u306f<a href=\"#data_version\">QR\u30b3\u30fc\u30c9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>error_correction<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306e\u4fee\u5fa9\u30bf\u30a4\u30d7\u3067\u3059\u3002<br \/>\n\u4f7f\u3048\u308b\u306e\u306f\u4ee5\u4e0b\u306e\uff14\u3064\u3002<\/p>\n<ul>\n<li>qrcode.constants.ERROR_CORRECT_L<\/li>\n<li>qrcode.constants.ERROR_CORRECT_M<\/li>\n<li>qrcode.constants.ERROR_CORRECT_Q<\/li>\n<li>qrcode.constants.ERROR_CORRECT_H<\/li>\n<\/ul>\n<p>\u4fee\u5fa9\u30bf\u30a4\u30d7\u306e\u8a73\u7d30\u306f\u3001<a href=\"#data_correction\">QR\u30b3\u30fc\u30c9\u306e\u4fee\u5fa9\u30bf\u30a4\u30d7<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>box_size<\/h3>\n<p>\u3072\u3068\u3064\u306e\u30bb\u30eb\u306e\u5927\u304d\u3055\u3002\u30d4\u30af\u30bb\u30eb\u5358\u4f4d\u3002<\/p>\n<h3>border<\/h3>\n<p>\u307e\u308f\u308a\u306e\u7a7a\u767d\u90e8\u5206\u306e\u592a\u3055\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f<code>\uff14<\/code>\u3002<\/p>\n<h3>fill_color<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306e\u5857\u308a\u3064\u3076\u3055\u308c\u308b\u90e8\u5206\u306e\u8272\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u9ed2\u3002<\/p>\n<h3>back_color<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306e\u80cc\u666f\u8272\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u767d\u3002<\/p>\n<h1>PHP\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h1>\n<p>\u958b\u767a\u74b0\u5883\uff1a PHP 7.2<\/p>\n<p>PHP\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b\u306b\u306f\u3044\u308d\u3044\u308d\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306fGitHub\u3067\u3082\u30b9\u30bf\u30fc\u3092\u591a\u304f\u7372\u5f97\u3057\u3066\u3044\u308b<a href=\"https:\/\/github.com\/chillerlan\/php-qrcode\" target=\"_blank\" rel=\"noopener noreferrer\">chillerlan\/php-qrcode<\/a>\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001<code>composer<\/code>\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>composer require chillerlan\/php-qrcode<\/strong><\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u5fc5\u8981\u8981\u4ef6\u306fPHP 7.2\u4ee5\u4e0a\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u904e\u53bb\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\uff08PHP 5.6+\uff09<\/p>\n<pre><strong>composer require chillerlan\/php-qrcode:1.0.8<\/strong><\/pre>\n<p>\u3067\u306f\u4f7f\u3044\u65b9\u3067\u3059\u3002<\/p>\n<h2>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n<pre><strong>$text = 'https:\/\/example.com';<\/strong>\r\n<strong>$qrcode = new \\chillerlan\\QRCode\\QRCode();<\/strong>\r\n<strong>$qrcode-&gt;render($text, 'qrcode_1.png');<\/strong><\/pre>\n<p>QRCode\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3066<code>render()<\/code>\u3092\u547c\u3076\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001PHP 5.6+\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f<code>render()<\/code>\u3092\u4f7f\u3063\u3066\u753b\u50cf\u3092\u4fdd\u5b58\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8ffd\u52a0\u30b3\u30fc\u30c9\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$base64_data = $qrcode-&gt;render($text);<\/strong>\r\n<strong>$base64_data = explode(';', $base64_data)[1];<\/strong>\r\n<strong>$base64_data = explode(',', $base64_data)[1];<\/strong>\r\n<strong>$data = base64_decode($base64_data);<\/strong>\r\n<strong>file_put_contents($path, $data);<\/strong><\/pre>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.5.22\u3011<\/strong>\u4fdd\u5b58\u30b3\u30fc\u30c9\u304c\u9593\u9055\u3063\u3066\u3044\u305f\u306e\u3067\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002m_ _m<\/p>\n<p>\u5b9f\u969b\u306b\u4fdd\u5b58\u3057\u305fQR\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2147\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-1.png\" alt=\"\" width=\"165\" height=\"165\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-1.png 165w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-1-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_1-1-100x100.png 100w\" sizes=\"auto, (max-width: 165px) 100vw, 165px\" \/><\/p>\n<p>\u203b \u308f\u304b\u308a\u306b\u304f\u3067\u3059\u304c\u3001\u80cc\u666f\u304c\u900f\u904e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u900f\u904e\u306b\u3057\u305f\u304f\u306a\u3044\u5834\u5408\u306f\u30aa\u30d7\u30b7\u30e7\u30f3<code>imageTransparent<\/code>\u3092<code>false<\/code>\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p><code>chillerlan\/php-qrcode<\/code>\u3067\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u306b\u306f\u3001<code>QROptions<\/code>\u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>$options = new \\chillerlan\\QRCode\\QROptions([\r\n    <\/strong>\/\/ \u3053\u3053\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u5024<strong>\r\n    'version'    =&gt; 5,\r\n    'imageTransparent' =&gt; false,\r\n    'scale' =&gt; 3\r\n]);<\/strong>\r\n\r\n$path = storage_path('qrcode_2.png');\r\n$text = 'https:\/\/example.com';\r\n$qrcode = new \\chillerlan\\QRCode\\QRCode(<strong>$options<\/strong>);\r\n$qrcode-&gt;render($text, $path);<\/pre>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u4f5c\u6210\u3057\u305fQR\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2146\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2-1.png\" alt=\"\" width=\"135\" height=\"135\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2-1.png 135w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/qrcode_2-1-100x100.png 100w\" sizes=\"auto, (max-width: 135px) 100vw, 135px\" \/><\/p>\n<p>\u3067\u306f\u4e3b\u8981\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u7d39\u4ecb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>version<\/h3>\n<p>\u30bb\u30eb\u306e\u500b\u6570\u3002<code>1<\/code>\u301c<code>40<\/code>\u3002<br \/>\n\u5bfe\u5fdc\u3059\u308b\u30bb\u30eb\u6570\u306f<a href=\"#data_version\">QR\u30b3\u30fc\u30c9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>eccLevel<\/h3>\n<p>\u4fee\u5fa9\u30bf\u30a4\u30d7\u3092\u6c7a\u3081\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3002<br \/>\n\u8a2d\u5b9a\u3067\u304d\u308b\u5024\u306f\u6b21\u306e\uff14\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>QRCode::ECC_L<\/li>\n<li>QRCode::ECC_M<\/li>\n<li>QRCode::ECC_Q<\/li>\n<li>QRCode::ECC_H<\/li>\n<\/ul>\n<p>\u3010\u8ffd\u8a18\uff1a2019.12.15\u3011\u8aad\u8005\u69d8\u304b\u3089\u3054\u6307\u6458\u3092\u53d7\u3051\u307e\u3057\u3066\u3001\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002\u89aa\u5207\u306b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<p>\u4fee\u5fa9\u30bf\u30a4\u30d7\u306e\u8a73\u7d30\u306f\u3001<a href=\"#data_correction\">QR\u30b3\u30fc\u30c9\u306e\u4fee\u5fa9\u30bf\u30a4\u30d7<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>addQuietzone<\/h3>\n<p>\u4f59\u767d\u3092\u3064\u3051\u308b\u304b\u3069\u3046\u304b\u3002<\/p>\n<h3>quietzoneSize<\/h3>\n<p>\u4f59\u767d\u306e\u30b5\u30a4\u30ba\u3002<\/p>\n<h3>outputType<\/h3>\n<p>\u51fa\u529b\u3059\u308b\u753b\u50cf\u30bf\u30a4\u30d7\u3067\u3059\u3002<\/p>\n<ul>\n<li>QROptions::OUTPUT_IMAGE_PNG\u3000\u30fb\u30fb\u30fb\u3000png<\/li>\n<li>QROptions::OUTPUT_IMAGE_JPG\u3000\u30fb\u30fb\u30fb\u3000jpg<\/li>\n<li>QROptions::OUTPUT_IMAGE_GIF\u3000\u30fb\u30fb\u30fb\u3000gif<\/li>\n<\/ul>\n<h3>scale<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002<\/p>\n<h3>imageTransparent<\/h3>\n<p>\u80cc\u666f\u3092\u900f\u904e\u306b\u3059\u308b\u304b\u3069\u3046\u304b\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<code>true<\/code>\u306a\u306e\u3067\u80cc\u666f\u3092\u767d\u304f\u3057\u305f\u3044\u5834\u5408\u306f<code>false<\/code>\u3092\u6307\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h1>JavaScript\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h1>\n<p>\u958b\u767a\u74b0\u5883\uff1a Google Chrome 70<\/p>\n<p><a href=\"https:\/\/github.com\/davidshimjs\/qrcodejs\" target=\"_blank\" rel=\"noopener noreferrer\">davidshimjs\/qrcodejs<\/a> \u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001<code>bower<\/code>\u304c\u975e\u63a8\u5968\u3068\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u4eca\u56de\u306f<code>git<\/code>\u3067<code>clone<\/code>\u3057\u307e\u3059\u3002<br \/>\n<code>js\/<\/code>\u30d5\u30a9\u30eb\u30c0\u306a\u3069\u3092\u4f5c\u3063\u3066\u305d\u3053\u3067\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>git clone https:\/\/github.com\/davidshimjs\/qrcodejs<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a9\u30eb\u30c0\u5185\u306b<code>qrcodejs<\/code>\u3068\u3044\u3046\u30d5\u30a9\u30eb\u30c0\u304c\u3067\u304d\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3053\u304b\u3089<code>js<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    <strong>&lt;script src=\"\/js\/qrcodejs\/qrcode.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h2>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    <strong>&lt;div id=\"qrcode\"&gt;&lt;\/div&gt;<\/strong>\r\n    &lt;script src=\"\/js\/qrcodejs\/qrcode.min.js\"&gt;&lt;\/script&gt;\r\n    <strong>&lt;script type=\"text\/javascript\"&gt;<\/strong>\r\n\r\n<strong>        var el = document.getElementById('qrcode');<\/strong>\r\n<strong>        var text = 'https:\/\/example.com';<\/strong>\r\n<strong>        new QRCode(el, text);<\/strong>\r\n\r\n<strong>    &lt;\/script&gt;<\/strong>\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u307e\u305a\u3001QR\u30b3\u30fc\u30c9\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u6240\u306b<code>&lt;div&gt;&lt;\/div&gt;<\/code>\u30bf\u30b0\u3092\u4f5c\u308a\u3001<code>QRCode()<\/code>\u306b\u305d\u306e\u30a8\u30ec\u30e1\u30f3\u30c8\u3068QR\u30b3\u30fc\u30c9\u306b\u3057\u305f\u3044\u6587\u5b57\u5217\u3092\u5165\u308c\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u305f\u753b\u50cf\u306f\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2152\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_1.png\" alt=\"\" width=\"256\" height=\"256\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_1.png 256w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_1-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_1-100x100.png 100w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/p>\n<h2>\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u6b21\u306e\u3088\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u7b2c\uff12\u5f15\u6570\u306f\u6587\u5b57\u5217\u304b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306a\u308a\u307e\u3059\uff09<\/p>\n<pre><strong>var options = {<\/strong>\r\n<strong>    text: 'https:\/\/example.com',<\/strong>\r\n<strong>    width: 128,<\/strong>\r\n<strong>    height: 128,<\/strong>\r\n<strong>    colorDark : \"#ff0000\",<\/strong>\r\n<strong>    colorLight : \"#ffff00\",<\/strong>\r\n<strong>    correctLevel : QRCode.CorrectLevel.H<\/strong>\r\n<strong>};<\/strong>\r\n<strong>new QRCode(el, options);<\/strong><\/pre>\n<p>\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u305fQR\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2154\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_2.png\" alt=\"\" width=\"128\" height=\"128\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_2.png 128w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/js_qrcode_2-100x100.png 100w\" sizes=\"auto, (max-width: 128px) 100vw, 128px\" \/><\/p>\n<p>\u3067\u306f\u5404\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3072\u3068\u3064\u305a\u3064\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>text<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306b\u3059\u308b\u6587\u5b57\u5217\u3002<\/p>\n<h3>width, height<\/h3>\n<p>\u6a2a\u5e45\u3068\u9ad8\u3055<\/p>\n<h3>colorDark<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306e\u5857\u308a\u3064\u3076\u3055\u308c\u308b\u90e8\u5206\u306e\u8272\u3002<\/p>\n<h3>colorLight<\/h3>\n<p>QR\u30b3\u30fc\u30c9\u306e\u80cc\u666f\u8272\u3002<\/p>\n<h3>correctLevel<\/h3>\n<p>\u4fee\u5fa9\u30bf\u30a4\u30d7\u3002<br \/>\n\u5229\u7528\u3067\u304d\u308b\u306e\u306f\u4ee5\u4e0b\u306e\uff14\u3064\u3002<\/p>\n<ul>\n<li>QRCode.CorrectLevel.L<\/li>\n<li>QRCode.CorrectLevel.M<\/li>\n<li>QRCode.CorrectLevel.Q<\/li>\n<li>QRCode.CorrectLevel.H<\/li>\n<\/ul>\n<p>\u4fee\u5fa9\u30bf\u30a4\u30d7\u306e\u8a73\u7d30\u306f\u3001<a href=\"#data_correction\">QR\u30b3\u30fc\u30c9\u306e\u4fee\u5fa9\u30bf\u30a4\u30d7<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>QR\u30b3\u30fc\u30c9\u306b\u95a2\u3059\u308b\u30c7\u30fc\u30bf<\/h1>\n<h2 id=\"data_version\">QR\u30b3\u30fc\u30c9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3<\/h2>\n<pre>1\u3000\u30fb\u30fb\u30fb\u300021\u00d721\r\n2\u3000\u30fb\u30fb\u30fb\u300025\u00d725\r\n3\u3000\u30fb\u30fb\u30fb\u300029\u00d729\r\n4\u3000\u30fb\u30fb\u30fb\u300033\u00d733\r\n5\u3000\u30fb\u30fb\u30fb\u300037\u00d737\r\n6\u3000\u30fb\u30fb\u30fb\u300041\u00d741\r\n7\u3000\u30fb\u30fb\u30fb\u300045\u00d745\r\n8\u3000\u30fb\u30fb\u30fb\u300049\u00d749\r\n9\u3000\u30fb\u30fb\u30fb\u300053\u00d753\r\n10\u3000\u30fb\u30fb\u30fb\u300057\u00d757\r\n11\u3000\u30fb\u30fb\u30fb\u300061\u00d761\r\n12\u3000\u30fb\u30fb\u30fb\u300065\u00d765\r\n13\u3000\u30fb\u30fb\u30fb\u300069\u00d769\r\n14\u3000\u30fb\u30fb\u30fb\u300073\u00d773\r\n15\u3000\u30fb\u30fb\u30fb\u300077\u00d777\r\n16\u3000\u30fb\u30fb\u30fb\u300081\u00d781\r\n17\u3000\u30fb\u30fb\u30fb\u300085\u00d785\r\n18\u3000\u30fb\u30fb\u30fb\u300089\u00d789\r\n19\u3000\u30fb\u30fb\u30fb\u300093\u00d793\r\n20\u3000\u30fb\u30fb\u30fb\u300097\u00d797\r\n21\u3000\u30fb\u30fb\u30fb\u3000101\u00d7101\r\n22\u3000\u30fb\u30fb\u30fb\u3000105\u00d7105\r\n23\u3000\u30fb\u30fb\u30fb\u3000109\u00d7109\r\n24\u3000\u30fb\u30fb\u30fb\u3000113\u00d7113\r\n25\u3000\u30fb\u30fb\u30fb\u3000117\u00d7117\r\n26\u3000\u30fb\u30fb\u30fb\u3000121\u00d7121\r\n27\u3000\u30fb\u30fb\u30fb\u3000125\u00d7125\r\n28\u3000\u30fb\u30fb\u30fb\u3000129\u00d7129\r\n29\u3000\u30fb\u30fb\u30fb\u3000133\u00d7133\r\n30\u3000\u30fb\u30fb\u30fb\u3000137\u00d7137\r\n31\u3000\u30fb\u30fb\u30fb\u3000141\u00d7141\r\n32\u3000\u30fb\u30fb\u30fb\u3000145\u00d7145\r\n33\u3000\u30fb\u30fb\u30fb\u3000149\u00d7149\r\n34\u3000\u30fb\u30fb\u30fb\u3000153\u00d7153\r\n35\u3000\u30fb\u30fb\u30fb\u3000157\u00d7157\r\n36\u3000\u30fb\u30fb\u30fb\u3000161\u00d7161\r\n37\u3000\u30fb\u30fb\u30fb\u3000165\u00d7165\r\n38\u3000\u30fb\u30fb\u30fb\u3000169\u00d7169\r\n39\u3000\u30fb\u30fb\u30fb\u3000173\u00d7173\r\n40\u3000\u30fb\u30fb\u30fb\u3000177\u00d7177<\/pre>\n<h2>QR\u30b3\u30fc\u30c9\u306e\u4fee\u5fa9\u30bf\u30a4\u30d7<\/h2>\n<p>QR\u30b3\u30fc\u30c9\u306f\u4e00\u90e8\u5206\u304c\u6b20\u3051\u3066\u3057\u307e\u3063\u3066\u3082\u30c7\u30fc\u30bf\u3092\u4fee\u5fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u3069\u306e\u7a0b\u5ea6\u307e\u3067\u8a31\u5bb9\u3067\u304d\u308b\u304b\u3067\uff14\u30bf\u30a4\u30d7\u304c\u3042\u308a\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u753b\u50cf\u30b5\u30a4\u30ba\u304c\u5909\u308f\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\uff09<\/p>\n<ul>\n<li>L\u3000\u30fb\u30fb\u30fb\u3000\uff17\uff05\u307e\u3067\u306a\u3089\u6b20\u3051\u3066\u3082OK<\/li>\n<li>M\u3000\u30fb\u30fb\u30fb\u300015\uff05\u307e\u3067\u306a\u3089\u6b20\u3051\u3066\u3082OK<\/li>\n<li>Q\u3000\u30fb\u30fb\u30fb\u300025\uff05\u307e\u3067\u306a\u3089\u6b20\u3051\u3066\u3082OK<\/li>\n<li>H\u3000\u30fb\u30fb\u30fb\u300030\uff05\u307e\u3067\u306a\u3089\u6b20\u3051\u3066\u3082OK<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u6700\u8fd1\u3067\u306f\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306f\u30db\u30f3\u30c8\u306b\u4e00\u822c\u7684\u306b\u306a\u3063\u3066\u3001\u4eca\u3067\u306f\u307b\u3068\u3093\u3069\u306e\u4eba\u304c\u5f53\u305f\u308a\u524d\u306e\u3088\u3046\u306b\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002 \u305d\u3057\u3066\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u6301\u305f\u306a\u3044\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306e\u305f\u3081 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2140\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Python, PHP, JavaScript\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u3063\u3066\u307f\u3088\u3046\uff01&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2156,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,10,39],"tags":[106],"class_list":["post-2140","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-php","category-python","tag-qr"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2140"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2140\/revisions"}],"predecessor-version":[{"id":7403,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2140\/revisions\/7403"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2156"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}