//文字水印 $dst_path = '111.jpg'; //创建图片的实例 $dst = imagecreatefromstring(file_get_contents($dst_path)); //打上文字 $font = './simsun.ttc';//字体 $black = imagecolorallocate($dst, 0x00, 0x00, 0x00);//字体颜色 imagefttext($dst, 13, 0, 20, 20, $black, $font, '你是不是傻');//文字水印 //输出图片 list($dst_w, $dst_h, $dst_type) = getimagesize($dst_path); switch ($dst_type) { case 1://GIF header('Content-Type: image/gif'); imagegif($dst); break; case 2://JPG header('Content-Type: image/jpeg'); imagejpeg($dst); break; case 3://PNG header('Content-Type: image/png'); imagepng($dst); break; default: break; } imagedestroy($dst);
图片文字水印
最新推荐文章于 2022-01-03 20:19:44 发布