|
本帖最后由 kkcckiss 于 2011-5-16 16:34 编辑
关于ci图片水印加中文水印文字问题
为什么我给新生成的图片打中文水印的时候是乱码呢,我的是utf8格式的,网上说要转码,转成utf8可是我本身就是utf8还是有乱码,即便用gb2312的页面将汉字转成utf8不行啊,请问高手们有什么办法没有 代码如下。
function wmpic(){
$this->load->library('image_lib');
$config['source_image'] = $_SERVER['DOCUMENT_ROOT']."/wbo/images/sdf.jpg";
$config['new_image'] = $_SERVER['DOCUMENT_ROOT'].'/wbo/new_bg.jpg';
$config['wm_text'] = '张江山';
$config['wm_type'] = 'text';
$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'] = 'center';//X
$config['wm_hor_alignment'] = 'center';//Y
$config['wm_padding'] = '5';
//$config['wm_vrt_offset'] = '10';
$this->image_lib->initialize($config);
if($this->image_lib->watermark())
{
echo " water ok";
}
else
{
echo "water error";
}
} |
|