有没有办法在图像上写一个立体文本,就像从文本作为附加照片一样PHP
?
我之前尝试过的:
$sourceImage = "photo.jpg";
$destinationImage = "new-photo.jpg";
$image = imagecreatefromjpeg($sourceImage);
$color = imagecolorallocate($image, 50, 50, 50);
$text = "A sample text";
$font = "font.ttf";
$fontSize = 18;
$rotation = 25;
$x = 370;
$y = 400;
$quality = 90;
imagettftext($image, $fontSize, $rotation, $x, $y, $color, $font, $text);
imagejpeg($image, $destinationImage, $quality);
任何想法或帮助将不胜感激。