<?php

/**
 * Example 003 - Setting QR Code quiet zone (Default is 2)
 *
 * NOTE: "QR Code" is registered trademarks of DENSO WAVE INCORPORATED in Japan
 *       and other countries.
 *
 *  The quiet zone uses the width of a QR Code element as measurement (the
 *  width of a "pixel"). This zone represents a border around the QR code, in
 *  which no disturbing elements should be located to support the image
 *  recognition of readers. The quiet zone should be 4 times as wide as a single
 *  QR Code element for optimal scanning results. As long as you do not define
 *  something else using this method, this class uses the default of 2.
 *
 *
 * <b>de: Beispiel 003 - Setzen der QR Code "quiet zone" (Standard ist 2)</b>
 *
 * Die Quiet Zone verwendet als Maßeinheit die Breite eines QR Code Moduls (also
 * die Breite eines "Datenpixels"). Sie stellt einen Rand um den QR Code dar, in
 * welchem sich keine störenden Elemente befinden sollten um die Bilderkennung
 * von Lesegeräten zu unterstützen. Für optimale Ergebnisse sollte die
 * "quiet zone" mindestens 4 Elemente breit sein. Standardmäßig wird von der
 * Klasse der Wert "2" verwendet.
 *
 * HINWEIS: "QR Code" ist eine von DENSO WAVE INCORPORATED in Japan und anderen
 *          Ländern eingetragene Marke.
 *
 *
 * PHP version 5
 *
 * LICENSE: This file is NOT free software. Try to contact the author(s) in
 *          doubt. Copyright injuries will be prosecuted!
 *
 * @copyright 2008-2009, EVERESTAH Ltd. & Co. KG
 * @link http://www.wikipedia.org/wiki/QR_Code
 * @link http://www.qrserver.com
 * @link http://goQR.me
 * @link http://www.bctester.de Free Barcode Reader for MS Windows
 * @link http://www.i-nigma.mobi Free QR Code Reader for mobile phones
 * @link http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=43655
 * @link http://www.denso-wave.com/qrcode/aboutqr-e.html
 */

//show source?
if (!empty($_GET["showsource"])) {
  
header("Content-Type: text/html; charset=UTF-8");
  
highlight_file(__FILE__);
  die();
}



//en: Import the required class
//de: Importieren der benötigten Klasse
require_once "./class.qrcode_create.inc.php";

//en: Create object
//de: Objekt erstellen
$qr = new qrcode_create();


//en: Set input which will be written into the QR Code
//de: Setzen den Inhalts, welcher in den QR Code geschrieben werden soll.
$qr->setInput("Hello World! With big quiet zone (10)!");



//en: Setting the "quiet zone" width to 10 elements
//    The quiet zone uses the width of a QR Code element as measurement (the
//    width of a "pixel").
//    This zone represents a border around the QR code, in which no disturbing
//    elements should be located to support the image recognition of readers.
//    The quiet zone should be 4 times as wide as a single QR Code element
//    for optimal scanning results.
//    As long as you do not define something else using this method, this
//    class uses the default of 2.
//de: Setzen der "quiet zone"-Breite auf 10 Elemente/Module.
//    Die Quiet Zone verwendet als Maßeinheit die Breite eines QR Code Moduls
//    (also die Breite eines "Datenpixels"). Sie stellt einen Rand um den QR
//    Code dar, in welchem sich keine störenden Elemente befinden sollten, um
//    die Bilderkennung von Lesegeräten zu unterstützen. Für optimale Ergebnisse
//    sollte  die "quiet zone" mindestens 4 Elemente breit sein. Standardmäßig
//    wird von der Klasse der Wert "2" verwendet.
$qr->setQuietZone(10);


//en: Set the edge length to 350 pixels
//de: Setzen der Kantenlänge auf 350 Pixel
$qr->setEdgeLength(350);


//en: Set the color "yellow" for the QR code modules (= data pixels) as RGB value
//    to better visualize the quiet zone.
//    -> http://en.wikipedia.org/wiki/RGB_color_model
//de: Setzen der Farbe "gelb" für den Hintergrund als RGB-Wert, um den
//    Randbereich/die "quiet zone" exemplarisch besser sichtbar zu machen.
//    -> http://de.wikipedia.org/wiki/RGB-Farbraum
$qr->setBgColor(//red
                
255,
                
//green
                
255,
                
//blue
                
0);


//en: Create the QR Code.
//    Hint: Whenever qrcode_create::create() is called, the currently set data,
//          color and stuff will be used to store the QR Code in memory
//          (overwriting eventually older ones). Therefore, it is easily
//          possible to change the data and call qrcode_create::create() again
//          to get a new QR Code, without having to work with multiple objects.
//de: Erstellen des QR Codes.
//    Tipp: Wann immer qrcode_create::create() aufgerufen wird, werden die
//          aktuell gesetzten Daten, Farben etc. dazu verwendet, den QR Code im
//          Speicher abzulegen (ein ggf. vorher erstellter Code wird dabei
//          überschrieben). Daher ist es ohne Weiteres möglich, Daten zu
//          ändern und anschließend einfach nochmals qrcode_create::create()
//          aufzurufen, um einen anderen QR Code zu erhalten, ohne mit mehreren
//          Objekten arbeiten zu müssen.
$qr->create();


//en: Display. If running on a webserver, all needed headers and stuff is
//    automatically sent to a webbrowser ready to view. If running in a
//    CLI SAPI environment, everything will be written to STDOUT.
//de: Anzeige. Sofern auf einem Webserver betrieben werden alle benötigten
//    Header etc. automatisch gesendet, damit die Grafik direkt in einem
//    Webbrowser betrachtet werden kann. In einer CLI SAPI-Umgebung würde alles
//    auf STDOUT geschrieben.
$qr->img_show();

?>