是否可以在 php 中动态地将文本放置在图像上?
然后将其发送到 rss feed?
是的,可以使用GD http://www.php.net/gd函数或图像魔术师 http://www.php.net/imagemagick功能,具体取决于您的服务器上安装的功能以及您喜欢的功能。
使用 GD 会是这样的:
<?php
$img = imagecreatefromjpeg('my.jpg');
$textColor = imagecolorallocate($img, 0, 0, 0); // black text
imagefttext($img, 13, 0, 105, 55, $textColor, './arial.ttf', 'Hello World');
// Output image to the browser
header('Content-Type: image/jpeg');
imagejpeg($img);
// Or save to file
imagejpeg($img, 'my-text.jpg');
imagedestroy($img);
?>
Edit:
要将图像放入您的 RSS 提要中,您可以将其保存到文件中并将 URL 放入您的提要中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)