Home > Backend Development > PHP Tutorial > PHP generates certificate of merit

PHP generates certificate of merit

藏色散人
Release: 2023-04-07 06:08:01
forward
3486 people have browsed it

ob_clean();
$realname = "姓名:最闲的码农";
$schoolname = "社区:Laravel"; 
$image = imagecreatefrompng('1562926506930.png');      //书模版图片文件的路径 必须是png格式的文件
$red = imagecolorallocate($image,00,00,00); // 字体颜色
// imageTTFText("Image", "Font Size", "Rotate Text", "Left Position","Top Position", "Font Color", "Font Name", "Text To Print");
//根据文本填写的位置不同
//"Left Position 和 Top Position 可以使用 getimagesize进行配合计算文字x和y轴坐标
imageTTFText($image, 50, 0, 628, 615, $red, 'simheittf.ttf',$realname);
imageTTFText($image, 50, 0, 628, 714, $red, 'simheittf.ttf', $schoolname);
header('Content-type: image/png;');
ImagePng($image);
imagedestroy($image);
$filename = 'certificate_aadarsh.png';
ImagePng($image, $filename);
imagedestroy($image);
Copy after login

WechatIMG3.jpeg

PHP generates certificate of merit

Related recommendations: "PHP Tutorial"

The above is the detailed content of PHP generates certificate of merit. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template