-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcitidot.php
More file actions
40 lines (31 loc) · 1.1 KB
/
Copy pathcitidot.php
File metadata and controls
40 lines (31 loc) · 1.1 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
<?php
header("Content-type: image/png");
$width = 24;
$height = 24;
$colorset = (isset($_GET['cs']) ? (int) $_GET['cs'] : 2);
$img = imagecreatetruecolor($width,$height);
imagelayereffect($img,IMG_EFFECT_ALPHABLEND);
if ( $colorset == 1 ) {
$fff = imagecolorallocatealpha($img,255,255,255,0);
$ink = imagecolorallocate($img,255,0,0);
}
elseif ( $colorset == 2 ) {
$fff = imagecolorallocatealpha($img,255,0,0,0);
$ink = imagecolorallocate($img,255,255,0);
}
for ( $c = 0; $c < (int) $_GET['cc']; $c++ ) {
$cx = mt_rand(3,$width - 3);
$cy = mt_rand(3,$height - 3);
#imagefilledellipse ( $img , $cx, $cy, 7, 7, $fff );
#imagefilledellipse ( $img , $cx, $cy, 5, 5, $ink );
#imagefilledellipse ( $img , $cx, $cy, 3, 3, $ink );
imagefilledrectangle ( $img , $cx-1, $cy-2, $cx+1, $cy+2, $fff );
imagefilledrectangle ( $img , $cx-2, $cy-1, $cx+2, $cy+1, $fff );
imagefilledrectangle ( $img , $cx-1, $cy-1, $cx+1, $cy+1, $ink );
#imagefilledrectangle ( $img , $cx, $cy, 5, 5, $ink );
}
$trans_index = imagecolorexact($img, 0, 0, 0);
imagecolortransparent($img, $trans_index);
imagepng($img);
imagedestroy($img);
?>