01.
02.
03.
04.
05.
06.
07.
08.
09.
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.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
|
|
<?php
/******************************************************************************/
/* */
/* __ ____ */
/* ___ / / ___ / __/__ __ _____________ ___ */
/* / _ \/ _ \/ _ \_\ \/ _ \/ // / __/ __/ -_|_-< */
/* / .__/_//_/ .__/___/\___/\_,_/_/ \__/\__/___/ */
/* /_/ /_/ */
/* */
/* */
/******************************************************************************/
/* */
/* Titre : Générer une image aléatoire de fond d'écran */
/* */
/* URL : http://www.phpsources.org/scripts255-PHP.htm */
/* Auteur : Cam */
/* Date édition : 04 Mars 2007 */
/* */
/******************************************************************************/
?>
<?php
//
//*****************************************************************************
//* ______ _____ _ _ _____ _ _ _____ _____ ___ ___*
//* |___ / | ____| | | | | | _ | | | | / ___| / _ / |/ |
// HTTP://WWW.GENERATOR.ZEUBU.COM
//* / / | |__ | | | | | |_| | | | | | | | | | | | / /| /| |
//* / / | __| | | | | | _ { | | | | | | | | | | / / |__/ | |
//* / /__ | |___ | |_| | | |_| | | |_| | _ | |___ | |_| | / / | |
//* /_____| |_____| _____/ |_____/ _____/ |_| _____| _____/ /_/ |_|
// CREATED BY CLEMENT VIALETTES
//*
// *
//*****************************************************************************
//
Header('Content-type: image/png');
$img = ImageCreate( 200, 200);
$colorbackgr = ImageColorAllocate( $img, , , );
//nombre de cercles
$u1 = Rand( 10, 20);
for( $i=1; $i < $u1; $i++)
{
//couleurs
$col1 = Rand( 71, 255);
$col2 = Rand( 71, 255);
$col3 = Rand( 71, 255);
//position des centres x y
$a1 = Rand( -5, 105);
$a2 = Rand( -5, 105);
//largeur et hauteur x y
$a3 = Rand( 5, 150);
$a4 = Rand( 5, 150);
//début du cercle et fin
$deg1 = Rand( , 360);
$deg2 = Rand( , 360);
//type de cercle
$a5 = Rand( , 1);
if($a5 == )
{
ImageArc( $img, $a1, $a2, $a3, $a4, $deg1, $deg2, ImageColorAllocate( $img,
$col1, $col2, $col3));
ImageArc( $img, $a1+1, $a2+1, $a3+1, $a4+1, $deg1+1, $deg2-1,
ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
ImageArc( $img, $a1-1, $a2-2, $a3-1, $a4-1, $deg1+1, $deg2-1,
ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
ImageArc( $img, $a1+2, $a2+2, $a3+2, $a4+2, $deg1+2, $deg2-2,
ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
ImageArc( $img, $a1-2, $a2-2, $a3-2, $a4-2, $deg1+2, $deg2-2,
ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
ImageArc( $img, $a1+3, $a2+3, $a3+3, $a4+3, $deg1+3, $deg2-3,
ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
ImageArc( $img, $a1-3, $a2-3, $a3-3, $a4-3, $deg1+3, $deg2-3,
ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
ImageArc( $img, $a1+4, $a2+4, $a3+4, $a4+4, $deg1+4, $deg2-4,
ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
ImageArc( $img, $a1-4, $a2-4, $a3-4, $a4-4, $deg1+4, $deg2-4,
ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
ImageArc( $img, $a1+5, $a2+5, $a3+5, $a4+5, $deg1+5, $deg2-5,
ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
ImageArc( $img, $a1-5, $a2-5, $a3-5, $a4-5, $deg1+5, $deg2-5,
ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
ImageArc( $img, $a1+6, $a2+6, $a3+6, $a4+6, $deg1+6, $deg2-6,
ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
ImageArc( $img, $a1-6, $a2-6, $a3-6, $a4-6, $deg1+6, $deg2-6,
ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
ImageArc( $img, $a1+7, $a2+7, $a3+7, $a4+7, $deg1+7, $deg2-7,
ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
ImageArc( $img, $a1-7, $a2-7, $a3-7, $a4-7, $deg1+7, $deg2-7,
ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
}
else
{
ImageArc( $img, $a1, $a2, $a3, $a4, $deg1, $deg2, ImageColorAllocate( $img,
$col1, $col2, $col3));
ImageArc( $img, $a1+1*Rand(-1,1), $a2+1*Rand(-1,1), $a3+1*Rand(-1,1), $a4+1*
Rand(-1,1), $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10,
$col3-10));
ImageArc( $img, $a1-1*Rand(-1,1), $a2-2*Rand(-1,1), $a3-1*Rand(-1,1), $a4-1*
Rand(-1,1), $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10,
$col3-10));
ImageArc( $img, $a1+2*Rand(-1,1), $a2+2*Rand(-1,1), $a3+2*Rand(-1,1), $a4+2*
Rand(-1,1), $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20,
$col3-20));
ImageArc( $img, $a1-2*Rand(-1,1), $a2-2*Rand(-1,1), $a3-2*Rand(-1,1), $a4-2*
Rand(-1,1), $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20,
$col3-20));
ImageArc( $img, $a1+3*Rand(-1,1), $a2+3*Rand(-1,1), $a3+3*Rand(-1,1), $a4+3*
Rand(-1,1), $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30,
$col3-30));
ImageArc( $img, $a1-3*Rand(-1,1), $a2-3*Rand(-1,1), $a3-3*Rand(-1,1), $a4-3*
Rand(-1,1), $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30,
$col3-30));
ImageArc( $img, $a1+4*Rand(-1,1), $a2+4*Rand(-1,1), $a3+4*Rand(-1,1), $a4+4*
Rand(-1,1), $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40,
$col3-40));
ImageArc( $img, $a1-4*Rand(-1,1), $a2-4*Rand(-1,1), $a3-4*Rand(-1,1), $a4-4*
Rand(-1,1), $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40,
$col3-40));
ImageArc( $img, $a1+5*Rand(-1,1), $a2+5*Rand(-1,1), $a3+5*Rand(-1,1), $a4+5*
Rand(-1,1), $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50,
$col3-50));
ImageArc( $img, $a1-5*Rand(-1,1), $a2-5*Rand(-1,1), $a3-5*Rand(-1,1), $a4-5*
Rand(-1,1), $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50,
$col3-50));
ImageArc( $img, $a1+6*Rand(-1,1), $a2+6*Rand(-1,1), $a3+6*Rand(-1,1), $a4+6*
Rand(-1,1), $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60,
$col3-60));
ImageArc( $img, $a1-6*Rand(-1,1), $a2-6*Rand(-1,1), $a3-6*Rand(-1,1), $a4-6*
Rand(-1,1), $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60,
$col3-60));
ImageArc( $img, $a1+7*Rand(-1,1), $a2+7*Rand(-1,1), $a3+7*Rand(-1,1), $a4+7*
Rand(-1,1), $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70,
$col3-70));
ImageArc( $img, $a1-7*Rand(-1,1), $a2-7*Rand(-1,1), $a3-7*Rand(-1,1), $a4-7*
Rand(-1,1), $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70,
$col3-70));
}
}
//image 100x100 a été crée
//symétrie
$x = ; $y = ;
while( $x <= 100)
{
for( $y=; $y<=100; $y++)
{
//image de droite
ImageSetPixel( $img, 200-($x), $y, ImageColorAt( $img, $x ,$y));
//image dessous gauche
ImageSetPixel( $img, $x, 200-$y, ImageColorAt( $img, $x, $y));
//image dessous droite
ImageSetPixel( $img, 200-$x, 200-$y, ImageColorAt( $img, $x, $y));
}
$x++;
}
//transparent ?
if(isset($noir)==1);
elseif(isset($transp)==1)
ImageColorTransparent( $img, ImageColorClosest( $img, , , ));
else
{
if( Rand(,1) == 1) ImageColorTransparent( $img, ImageColorClosest( $img, , , )
);
}
// On crée l'image
ImagePng($img);
// On libère l'espace mémoire alloué à l'image
ImageDestroy($img);
?>
|