par
Wells83 » 03 oct. 2007, 16:56
Bonjour à tous. Je cherche le moyen d'empiler plusieurs images PNG dans une même cellule.
Pour l'instant je créer un <table> dans lequel je met une image. Ca marche trés bien, l'excel généré à bien l'image.
Le problème est que j'ai beau faire, je n'arrive pas à empiler deux images différentes.
D'ailleurs si qq'un sais au passage si la transparence est géré dans excel, me semble que oui mais bon...
Mon code: (ne pas se soucier des variables qui manque, j'ai enlever les bouts de codes venant de la BDD par sécurité)
<?php
header("Content-Type: application/x-msexcelx; name=\"Export Excel généré le ".date(d).'/'.date(m).'/'.date(Y).".xls\"");
header("Content-Disposition: inline; filename=\"Export Excel généré le ".date(d).'/'.date(m).'/'.date(Y).".xls\"");
$xd=80;$xf=130;
$yd=40;$yf=100;
$xd=100;$xf=130;
$yd=80;$yf=100;
?>
<table cellpadding="0" cellspacing="0" border="0">
<?
echo '<tr><td style="width:20px;height:20px;text-align:center;"></td>'; for($x=$xd;$x<$xf+1;$x++)echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$x.'</td>'; echo '<td style="width:20px;height:20px;text-align:center;"></td></tr>';
for($y=$yd;$y<$yf+1;$y++)
{
echo '<tr><td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$y.'</td>';
for($x=$xd;$x<$xf+1;$x++)
{
$jo=$J[$x][$y];
if($jo>0)
echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;border:1px solid '.$C[$jo].';">
<img src="http://www.septentrion-game.com/WIKI/IMAGE/LIEU/BIBLIO/'.$CLI[$x][$y].'.png" width="20" alt="toto" title="toto" />
</td>';
else
echo '<td style="width:20px;height:20px;text-align:center;background-color:black;"></td>';
}
echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$y.'</td></tr>';
}
echo '<tr><td style="width:20px;height:20px;text-align:center;"></td>'; for($x=$xd;$x<$xf+1;$x++)echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$x.'</td>'; echo '<td style="width:20px;height:20px;text-align:center;"></td></tr>';
?>
</table>
Bonjour à tous. Je cherche le moyen d'empiler plusieurs images PNG dans une même cellule.
Pour l'instant je créer un <table> dans lequel je met une image. Ca marche trés bien, l'excel généré à bien l'image.
Le problème est que j'ai beau faire, je n'arrive pas à empiler deux images différentes.
D'ailleurs si qq'un sais au passage si la transparence est géré dans excel, me semble que oui mais bon...
Mon code: (ne pas se soucier des variables qui manque, j'ai enlever les bouts de codes venant de la BDD par sécurité)
[php]<?php
header("Content-Type: application/x-msexcelx; name=\"Export Excel généré le ".date(d).'/'.date(m).'/'.date(Y).".xls\"");
header("Content-Disposition: inline; filename=\"Export Excel généré le ".date(d).'/'.date(m).'/'.date(Y).".xls\"");
$xd=80;$xf=130;
$yd=40;$yf=100;
$xd=100;$xf=130;
$yd=80;$yf=100;
?>
<table cellpadding="0" cellspacing="0" border="0">
<?
echo '<tr><td style="width:20px;height:20px;text-align:center;"></td>'; for($x=$xd;$x<$xf+1;$x++)echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$x.'</td>'; echo '<td style="width:20px;height:20px;text-align:center;"></td></tr>';
for($y=$yd;$y<$yf+1;$y++)
{
echo '<tr><td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$y.'</td>';
for($x=$xd;$x<$xf+1;$x++)
{
$jo=$J[$x][$y];
if($jo>0)
echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;border:1px solid '.$C[$jo].';">
<img src="http://www.septentrion-game.com/WIKI/IMAGE/LIEU/BIBLIO/'.$CLI[$x][$y].'.png" width="20" alt="toto" title="toto" />
</td>';
else
echo '<td style="width:20px;height:20px;text-align:center;background-color:black;"></td>';
}
echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$y.'</td></tr>';
}
echo '<tr><td style="width:20px;height:20px;text-align:center;"></td>'; for($x=$xd;$x<$xf+1;$x++)echo '<td style="width:20px;height:20px;text-align:center;font-size:8px;">'.$x.'</td>'; echo '<td style="width:20px;height:20px;text-align:center;"></td></tr>';
?>
</table>[/php]