软件介绍:<?php// 获取 img 目录下所有 JPG 和 PNG 图片$bg_images = glob(‘img/*.{jpg,png}‘, GLOB_BR...
<?php
// 获取 img 目录下所有 JPG 和 PNG 图片
$bg_images = glob('img/*.{jpg,png}', GLOB_BRACE);
// 随机选择一张图片作为背景
$bg_image = $bg_images[array_rand($bg_images)];
// 读取背景图片并创建画布
$bg = imagecreatefromjpeg($bg_image);
$width = imagesx($bg);
$height = imagesy($bg);
$image = imagecreatetruecolor($width, $height);
// 将背景图拷贝到画布上
imagecopy($image, $bg, 0, 0, 0, 0, $width, $height);
// 添加水印文字
$text = '土嘎嘎是一家技术分享网站!';
$font = 'msyh.ttf'; // 字体文件路径
$size = 19; // 字体大小
$angle = 0; // 水印旋转角度
$color = imagecolorallocate($image, 255。。。。。。。。。。。。。。。。。。。。。。。。。。。。。