-
Notifications
You must be signed in to change notification settings - Fork 0
/
make house by php.php
114 lines (80 loc) · 2.07 KB
/
make house by php.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html>
<head>
<title>Piramit </title>
<style>
.piramit{
width:1500px;
float:left;
text-align:center;
}
</style>
</head>
<body style="height:3000px">
<div class="piramit">
<?php
class drawimage
{
public $image;
public function rectangleborder() {
// create image
$this->image = imagecreatetruecolor(75, 38);
$white = imagecolorallocate($this->image, 255, 255, 255);
// Draw a white rectangle
imagefilledrectangle($this->image, 1, 1, 73, 36, $white);
// Begin capturing the byte stream
ob_start();
// generate the byte stream
imagejpeg($this->image, NULL, 100);
// and finally retrieve the byte stream
$rawImageBytes = ob_get_clean();
echo "<img src='data:image/jpeg;base64," . base64_encode( $rawImageBytes ) . "' />";
}
public function rectangle() {
$this->image = imagecreatetruecolor(75,38);
$bg = imagecolorallocate($this->image,200,50,100);
imagefilledrectangle($this->image,0,0,75,38,$bg);
// Begin capturing the byte stream
ob_start();
// generate the byte stream
imagejpeg($this->image, NULL, 100);
// and finally retrieve the byte stream
$rawImageBytes = ob_get_clean();
echo "<img src='data:image/jpeg;base64," . base64_encode( $rawImageBytes ) . "' />";
}
}
$draw = new drawimage;
// echo '<img src="brick.png"/><br>' ;
for($i=9;$i<=30;$i++){
if($i==19){
echo '<p style="margin-left: 101px;margin-right: 101px;padding: 0px;margin-top: -13px;box-shadow: 1px 16px 9px 2px #0e0d0d;"> </p>';
}
$draw->rectangleborder() ;
if($i>18){
$k=16;
}else{
$k=$i;
}
for($j=1;$j<=$k;$j++){
if($i>21 && $i<26 ){
if($j>1 && $j<4 || $j>6 && $j<10 || $j>12 && $j<15 ){// widnow & door(4 column)
$draw->rectangle() ;
}else{
$draw->rectangleborder() ;
}
}elseif($i>25 && $i<29 ){// door
if( $j>6 && $j<10 ){
$draw->rectangle() ;
}else{
$draw->rectangleborder() ;
}
}else{
$draw->rectangleborder() ;
}
}
echo '<br/>';
}
?>
</div>
</body>
</html>