赞
踩
PHP图片添加水印类
class imagelogo
{
var $input_image_file = ""; //输入图片的文件名
var $output_image_file = ""; //生成文件的名称
var $logo_image_name = ""; //包含存放路径的水印图片的文件名
var $logo_text = ""; //水印文字
var $logo_text_size = 18; //水印文字大小
var $logo_text_angle = 4; //水印文字角度
var $logo_text_pos = 6; //水印文字放置位置
var $logo_text_font = ""; //水印文字的字体
var $logo_text_color = "#ffffff"; //水印字体的颜色值
var $logo_image_pos = 6; //水印图片放置的位置
//1 = 顶部居左,2 = 顶部居中,3 = 顶部居右,4 = 底部居左
//5 = 底部居中,6 = 底部居右,7 = 中间居左,8 = 居中,9 = 中间居右
var $logo_image_transition = 25; //水印图片与原图片的融合度(1=100)
var $jpeg_quality = 75; //jpeg图片的质量
//生成水印图片
function create($filename="")
{
if ($filename)
{
$this->input_image_file = strtolower(trim($filename));
}
$src_image_type = $this->get_type($this->input_image_file);
$src_image = $this->createImage($src_image_type,$this->input_image_file);
if (!$src_image)
{
return;
}
$src_image_w=imagesx($src_image);
$src_image_h=imagesy($src_image);
//开始处理水印logo图片信息,把两个图片合成为一个图片
if ($this->logo_image_name)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。