1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
function supAlpha($name)
{
$photoJeu = imagecreatefrompng($name);
list($larg,$haut)=getimagesize($name);
$image = imagecreatetruecolor($larg,$haut); // Création d'une nouvelle image
/*On remplit la miniature avec un blanc opaque*/
imagealphablending($image, false);
imagesavealpha($image,true);
$blanc= imagecolorallocatealpha($image, 255, 255, 255, 127);
imagefill($image,0,0,$blanc);
imagecopymerge($image, $photoJeu, 0, 0, 0, 0, $larg,$haut,100);
imagejpeg($image,"photos/$jeu.jpg");
$monImage['nom']="photos/$jeu.jpg";
$monImage['largeur']=$larg;
$monImage['hauteur']=$haut;
imagedestroy($photoJeu);
imagedestroy($image);
return $monImage;
} |
Partager