CreateImage.php 905 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. header("Content-type: image/png");
  3. $string = htmlspecialchars($_GET["WaNr"]);
  4. $posi = htmlspecialchars($_GET["Posi"]);
  5. $nfcid = htmlspecialchars($_GET["Nfcid"]);
  6. //$stringposi = htmlspecialchars($_GET["Position"]);
  7. $im = imagecreatefrompng("background_klein.png");
  8. //$im = imagecreate( 1920, 1080 );
  9. $background = imagecolorallocate( $im, 255, 255, 255 );
  10. $grey = imagecolorallocate( $im, 30, 30, 30 );
  11. $font = './OpenSans.ttf';
  12. imagettftext($im, 40, 0, 20, 50, $grey, $font, "Bitte eine Seriennummer zu diesen Daten scannen:");
  13. imagettftext($im, 40, 0, 20, 180, $grey, $font, "WA-NR: " . $string);
  14. imagettftext($im, 40, 0, 20, 250, $grey, $font, "Position: " . $posi);
  15. imagettftext($im, 20, 0, 20, 350, $grey, $font, "NFC ID: " . $nfcid);
  16. //imagettftext($im, 50, 0, 200, 630, $grey, $font, "Stimmt die Position: " . $stringposi);
  17. imagepng($im);
  18. imagedestroy($im);
  19. ?>