index.php
1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* REQUIRE:
* * apt-get install php5-imagick
* * .htaccess -> _htaccess
* * Apache rewrite Modul
*
*
*/
require_once('basepath.inc.php');
require_once($__PATH_to_mcClasses . 'include.php');
if(array_key_exists('qrcode', $_POST) && $_POST['qrcode']) {
$qrtxt = $_POST['qrcode'];
$qrcode_size = $_POST['qrcode_size'];
$margin = $_POST['qrcode_margin'];
$tmp_qrfilepath = 'tmp/tmp_qrfile.png';
QRcode::png($qrtxt, $tmp_qrfilepath , $level = QR_ECLEVEL_L, $size = 10, $margin, $saveandprint=false);
$qr_image = new Imagick($tmp_qrfilepath);
$qr_image->scaleImage($qrcode_size,$qrcode_size);
header('Content-type: image/png');
echo $qr_image;
} else {
?>
<form action="index.php" method="post">
<table border="0" cellpadding="5" cellspacing="0" bgcolor="#E0E0E0">
<tr>
<td align="right">size:</td>
<td><input name="qrcode_size" type="text" size="10" maxlength="10" value="600"></td>
</tr>
<tr>
<td align="right">margin:</td>
<td><input name="qrcode_margin" type="text" size="10" maxlength="10" value="2"></td>
</tr>
<tr>
<td align="right" valign="top">text to qrcode:</td>
<td><textarea name="qrcode" cols="50" rows="10"></textarea></td>
</tr>
<tr>
<td align="right">Formular:</td>
<td>
<input type="submit" value=" Absenden ">
<input type="reset" value=" Abbrechen">
</td>
</tr>
</table>
</form>
<?php
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//$image->thumbnailImage(100, 0);
// bild größe skalieren
// $image->adaptiveResizeImage(1024,768);
// $image->scaleImage(800,800);
// $qr_image->setSize(800,800);
?>