Repository navigation
Expand file tree
/
Copy pathrand.php
More file actions
42 lines (41 loc) · 1.36 KB
/
Copy pathrand.php
File metadata and controls
42 lines (41 loc) · 1.36 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
<?php
// header('Content-type:image/png');
// $width = 500;
// $height = 500;
// $im = imagecreatetruecolor($width, $height);
// for ($i = 0; $i < $width; $i++) {
// for ($j = 0; $j < $height; $j++) {
// $color = imagecolorallocate($im, 0, 0, 0);
// if ($i > 252) {
// if (rand(0, 1) == 1) {
// $color = imagecolorallocate($im, 255, 255, 255);
// }
// } elseif ($i < 248) {
// if (mt_rand(0, 1) == 1) {
// $color = imagecolorallocate($im, 255, 255, 255);
// }
// } else {
// $color = imagecolorallocate($im, 255, 255, 255);
// }
// imagesetpixel($im, $i, $j, $color);
// }
// }
// // $color = imagecolorallocate($im, 200, 200, 200);
// // imagefill($im, 0, 0, $color);
// // imagecolorset($im, 100, 0, 0, 0);
// // imagecolorallocate($im, 200, 200, 200);
// imagepng($im);
// imagedestroy($im);
// header("Content-type: image/png");
// $im = imagecreatetruecolor(512, 512)
// or die("Cannot Initialize new GD image stream");
// $white = imagecolorallocate($im, 255, 255, 255);
// for ($y = 0; $y < 512; $y++) {
// for ($x = 0; $x < 512; $x++) {
// if (rand(0, 1) === 1) {
// imagesetpixel($im, $x, $y, $white);
// }
// }
// }
// imagepng($im);
// imagedestroy($im);