您的位置:首页 > 编程语言 > PHP开发

php图像处理-邀请函附上信息

2017-04-08 09:55 288 查看
<?php
//实例:TTF字体的文本
$filename = './sucai/invitation.jpg';
$image = imagecreatefromjpeg($filename);
$size = 16;
$angle = 0;
$x = 220;
$y = 450;
$color = imagecolorallocate($image, 0, 0, 0);
// $color = imagecolorallocatealpha($image, mt_rand(1,200), mt_rand(1,200), mt_rand(1,200),mt_rand(0,127));
$fontfile = './sucai/simkai.ttf';
$text = '展会号:732D,
公司名称:廊坊会议展览有限公司
品牌名称:阿迪达斯';
imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text);
//image 图像的资源
//size ttf字体的大小
//angle 角度
//x, y , ttf文字,左上角的坐标
//color 字体的颜色
//fontfile ttf 字体的文件所在的路径
//text 文本内容
//
header('content-type:image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: