|
本帖最后由 zhangcjl 于 2011-2-28 11:24 编辑
这张图浏览器实际显示的图,我是用一个纯色的jpg图片做底色图,然后再加一个中间是透明的gif图片,然后就用CI的水印处理,用纯色的jpg的图片做原始图片,
然后用中间透明的图片作为水印打上去,但是悲催的事情发生了
这张图是实际生成的图片,。。。。。。本来中间是透明的,现在中间是不透明的,周围是不透明的,实际生成却成了透明的,不知道什么原因。,悲催。。。。
现在贴代码;
PHP复制代码
function do_bg_pic ()
{
$action = $this->input->post('Action');
if($action!="dobgpic")
{
echo "错误操作!";
}
$this->load->library('image_lib');
//$config['image_library'] = 'gd2';
$bg = $this->input->post('bg_img');
$hw = $this->input->post('sjg_img');
$config['source_image'] = "./uploads/bg/bg1.jpg";
$config['wm_overlay_path'] = "./uploads/wm/sjg.gif";
$new_bg_name = time();
$config['new_image'] = 'uploads/wmnew/'.$new_bg_name.'.gif';
//$config['wm_text'] = 'water mark';
$config['wm_type'] = 'overlay';
$config['dynamic_output'] = FALSE;
//$config['wm_font_path'] = './system/fonts/texb.ttf';
//$config['wm_font_size'] = '16';
//$config['wm_font_color'] = '000000';
$config['wm_vrt_alignment'] = 'top';//X轴
$config['wm_hor_alignment'] = 'left';//Y轴
$config['wm_hor_offset'] = '0';//X轴
$config['wm_vrt_offset'] = '0';//Y轴
//$config['wm_padding'] = '1';
$config['wm_opacity'] = '100';
$this->image_lib->initialize($config);
if($this->image_lib->watermark())
{
//echo " water ok";
echo $new_bg = $new_bg_name.'.gif';
}
else
{
echo "do water mark error!";
}
}
复制代码
把背景图片和水印图片打包,麻烦各位大大测试下~~~
pic.rar
(3.81 KB, 下载次数: 5)
|
|