🛀 examples cleanup

This commit is contained in:
smiley
2023-09-03 15:29:24 +02:00
parent 17e8ccae62
commit a19b7f4fbd
19 changed files with 571 additions and 539 deletions
+16 -10
View File
@@ -1,6 +1,7 @@
<?php
/**
* example for additional text
* GdImage example for displaying additional text under the QR Code
*
* @link https://github.com/chillerlan/php-qrcode/issues/35
*
* @created 22.06.2019
@@ -93,22 +94,27 @@ class QRImageWithText extends QRGdImage{
* Runtime
*/
$options = new QROptions([
'version' => 7,
'outputType' => QROutputInterface::GDIMAGE_PNG,
'scale' => 3,
'imageBase64' => false,
]);
$options = new QROptions;
$options->version = 7;
$options->outputType = QROutputInterface::GDIMAGE_PNG;
$options->scale = 3;
$options->imageBase64 = false;
$qrcode = new QRCode($options);
$qrcode->addByteSegment('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
header('Content-type: image/png');
// invoke the custom output interface manually
$qrOutputInterface = new QRImageWithText($options, $qrcode->getQRMatrix());
// dump the output, with additional text
// the text could also be supplied via the options, see the svgWithLogo example
echo $qrOutputInterface->dump(null, 'example text');
$out = $qrOutputInterface->dump(null, 'example text');
header('Content-type: image/png');
echo $out;
exit;