Bonjour à tous, je genère une carte à partir de 3 images :

http://www.hommk.net/final/mappa/0.png
http://www.hommk.net/final/mappa/4.png
http://www.hommk.net/final/mappa/32.png

Avec le code suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
	$size=36; // nombre de cases
	$format=32; // taille d'une demi case
	$carte =  imagecreate(2*$format*$size,$format*$size);
	$bg = imagecolorallocate ( $carte, 255, 255, 255 );
	imagecolortransparent($carte,$bg);
 
	$images = array(
		0=>imagecreatefrompng("0.png"),
		4=>imagecreatefrompng("4.png"),
		32=>imagecreatefrompng("32.png")
	);
 
 
	for($y=0;$y<$size;$y++){
		for($x=$size-1;$x>=0;$x--){
			/* RECUPERE DANS UNE REQUETE SQL */
			$data = mysql_fetch_array($request);
			$type = $data['TYPE'];
 
			$img = $images[$type];
 
			imagecopy($carte, $img, ($x+$y)*$format, ($y-$x+$size)*($format/2), 0, 0, 2*$format, 2*$format);
		}
	}
 
	imagepng($carte,"graux_177.png");
Et voici le résultat :

http://www.hommk.net/final/mappa/graux_177.png

C'est quasi bon sauf que mes châteaux (32.png) sont devenus transparents sur ma carte .. Savez-vous comment faire pour qu'ils ne le soient pas ?

Merci d'avance.