나는 이것으로 내 머리카락을 찢어 버리고 여기에 많은 쓸모없는 해결책을 시도했다.GD Lib로 텍스트 추가
이미지에 텍스트를 추가하려고하지만 배경 이미지가 모두 보이기 때문에 여기에서 잘못하고있는 것이 눈에 띄지 않습니다. adcance
<?
header('Content-Type: image/jpeg');
$fbid = $_POST['fbid'];
$background_img = $_POST['background'];
$message = $_POST['text'];
$ts = $_POST['ts'];
$filename = $fbid . "-" . $ts . ".jpg";
$image_canvas = imagecreatetruecolor(640,400);
$background = imagecreatefromjpeg($background_img);
$overlay = imagecreatefrompng("../images/image-overlay.png");
imagecopyresampled($background, $overlay, 0, 0, 0, 0, imagesx($overlay), imagesy($overlay), imagesx($overlay), imagesy($overlay));
imagefilledrectangle($image_canvas, 0,0,150,30, $background);
$white = imagecolorallocate($background, 255, 255, 255);
imagettftext($image_canvas, 25, 0, 50, 50, $white, "arial.TTF", $message);
imagejpeg($background,"../created/" . $filename, 100);
imagedestroy($background);
arial에 대한 경로입니다 .TFTF, 전체 경로를 시도해 보셨습니까? – somedev
arial.ttf는이 예제 스크립트의 스크립트와 같은 폴더에 있습니다. –
'$ filename'이 (가) 정의되지 않았습니다 ... –