正在为你努力加载中........

点滴记录 分享
4
2014-5
首页 >> CodeIgniter >> CI 图片加水印

CI 图片加水印

        $this->load->library('image_lib');
        $config['image_library'] = 'GD2';
        $config['source_image'] = FCPATH."/3.png";
        $config['create_thumb'] = FALSE;
        $config['wm_type'] = 'overlay';
        $config['wm_opacity'] = 4;
        $config['quality'] = 4;
        $config['wm_vrt_alignment'] = 'bottom';
	$config['wm_hor_alignment'] = 'center';
        //$config['wm_hor_offset'] = 300;
       // $config['wm_vrt_offset'] = 150;
	$config['dynamic_output'] = false ;
        $config['wm_overlay_path'] = FCPATH.'logo.png';//水印图片
	$config['new_image'] = FCPATH.'/new.png';  //重新明媚图片 保证原来图片不被覆盖
        $this->load->library('image_lib', $config);
        $this->image_lib->initialize($config);
        if ( ! $this->image_lib->watermark()){
            exit($this->image_lib->display_errors());
        }else{
            echo 'success';
        }

作者:一根烟的寂寞 分类:CodeIgniter
浏览:1684 评论:0

发表评论: