source: trunk/client/inc/hpdf5/spipu/html2pdf/examples/res/example09.png.php@ 429

Last change on this file since 429 was 347, checked in by roby, 4 years ago

Aggiornamento per compatibilità con php7.4

File size: 681 bytes
Line 
1<?php
2$px = isset($_GET['px']) ? $_GET['px'] : 0;
3$px = preg_replace('/[^0-9]/isU', '', $px);
4
5$py = isset($_GET['py']) ? $_GET['py'] : 0;
6$py = preg_replace('/[^0-9]/isU', '', $py);
7
8if ($px<1) {
9 $px = 5;
10}
11if ($py<1) {
12 $py = 5;
13}
14
15if ($px>20) {
16 $px = 20;
17}
18if ($py>20) {
19 $py = 20;
20}
21
22 $width = 100;
23 $height = 100;
24 $im = imagecreatetruecolor($width, $height);
25
26for ($y=0; $y<$height; $y+= $py) {
27 for ($x=0; $x<$width; $x+= $px) {
28 $c = imagecolorallocate($im, 200-$x, 100+$y, 100+$x-$y);
29 imagefilledrectangle($im, $x, $y, $x+$px, $y+$py, $c);
30 }
31}
32
33 header("Content-type: image/png");
34 imagepng($im);
35 imagedestroy($im);
Note: See TracBrowser for help on using the repository browser.