-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimageGen.php
43 lines (29 loc) · 970 Bytes
/
imageGen.php
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
<?php
session_start();
$a = $_SESSION[mailsto];
$r = $_SESSION[mailsto]/2;
$b = $_SESSION[mailsfrom];
$r1 = $_SESSION[mailsfrom]/2;
$ch = 160/2;
$cw = 300/2;
$relmarginl = (($_SESSION[relationship])/100)*$r;
$relmarginr = (($_SESSION[relationship])/100)*$r1;
$offset = $cw - $r + $relmarginl;
$offset1 = $cw + $r1 - $relmarginr;
#FDDC61
// Create transparent background
$img = imagecreatetruecolor(300 , 160);
imagesavealpha($img, true);
$bg = imagecolorallocatealpha($img, 0, 0, 0, 127);
imagefill($img, 0, 0, $bg);
//create color for left circle
$col = imagecolorallocatealpha($img, 147, 147, 147, 80);
//create left circle size and position
imagefilledellipse($img, $offset, $ch, $a, $a, $col);
//create color for right circle
$col1 = imagecolorallocatealpha($img, 243, 222, 141, 35);
//create right circle size and position
imagefilledellipse($img, $offset1, $ch, $b, $b, $col1);
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);