0

我想在我的网站上为用户创建证书,但是以下代码不起作用,并且在本地主机上加载时仅显示灰色方块...

<?php
header('content-type:image/jpeg');
$font="BRUSHSCI.TTF";
$image=imagecreatefromjpeg("certificate.jpg");
$color=imagecolorallocate($image,19,21,22);
$name="Name";
imagettftext($image,50,0,365,420,$color,$font,$name);
$date="12th may 2021";
imagettftext($image,20,0,450,595,$color,"AGENCYR.TTF",$date);
imagejpeg($image);
imagedestroy($image);
?>

当我运行上面的代码时得到这个输出:
我在上面运行代码时得到的这个输出

4

0 回答 0