我一直在用这个扯掉我的头发,并在这里尝试了很多很多解决方案,但无济于事。
我正在尝试向图像添加一些文本,但它所做的只是显示我的背景图像,这里有什么明显的地方我做错了吗?
提前致谢
<?
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);