Voila mon site permet d'upload des images depuis un espace administrateur !
Celui-ci permet de choisir la position de l'image sur un fond de 575 par 302.
j'aimerais ajouter un texte automatiqument centrer sous cette image !
Le probleme c'est que je ne vois pas comment adapter les positions de mon texte.
Voici mon code:
Code : Tout sélectionner
function __construct($fond, $uid, $fid, $uCords, $un){
$this->ext($fond);
$this->fond = $this->resize($this->fond, 575, 302,'');
$bg = imagecolorallocate($this->fond, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
// Mon image
$uC = $this->SR_Array($uCords);
if($uC['status'] == '200'){
$this->avUser = $this->prepareImg($this->GetPhoto($uid), $uC['s'],$un);
imagecopy($this->fond,$this->avUser, $uC['x'], $uC['y'], 0, 0, $uC['s'], $uC['s']);
// Mon texte que voudrais aligné automatiquement sous mon image
imagestring($this->fond, 5, 50, 302 - 100, explode(" ",$un)[0] , $textcolor);
}
imagejpeg($this->fond);
}
