[7.X版] 帝国cms常见问题:缩略图函数改进(GD库改进)
帝国CMS缩略图函数改进(GD库改进)
本文关键字词:缩略图,缩略图函数,帝国CMS,帝国CMS,帝国CMS缩略图去黑边框
第一种方式 帝国默认:
sys_ResizeImg($r[titlepic],宽,高,0);//帝国默
帝国CMS(EmpireCMS)缩略图函数改进(GD库改进)
本文关键字词:缩略图,缩略图函数,帝国CMS(EmpireCMS),帝国CMS(EmpireCMS),帝国CMS(EmpireCMS)缩略图去黑边框
第一种方式 帝国默认:
sys_ResizeImg($r[titlepic],宽,高,0);//帝国默认的不裁剪缩放生成缩略图的方式
第二种方式 帝国默认:
sys_ResizeImg($r[titlepic],宽,高,1);//帝国默认的裁剪缩放生成缩略图的方式
第三种方式 去掉裁剪不够时的黑边并且从图片缩放后中间裁剪:
sys_ResizeImg($r[titlepic],宽,高,2);//新加去黑边裁剪生成缩略图的方式
第四种方式 只固定图片的宽,高度不限制(类似不规则瀑布流的图片形式),高填写为大于0的任意整数数字:
sys_ResizeImg($r[titlepic],宽,高,3);//新加去黑边生成类似瀑布流格式的方式
前台调用方式如下<?=sys_ResizeImg($r[titlepic],宽,高,3) ?>
/e/class/gd.php 函数全部代码如下:
<?php
define('InEmpireCMSGd',TRUE);//原文件,新文件,宽度,高度,维持比例
function ResizeImage($big_image_name, $new_name, $max_width = 400, $max_height = 400, $resize = 1){
$returnr['file']='';
$returnr['filetype']='';
if($temp_img_type = @getimagesize($big_image_name)) {preg_match('//([a-z]+)$/i', $temp_img_type[mime], $tpn); $img_type = $tpn[1];
}else{
preg_match('/.([a-z]+)$/i', $big_image_name, $tpn); $img_type = $tpn[1];
}
$all_type = array(
"jpg" => array("create"=>"ImageCreateFromjpeg", "output"=>"imagejpeg" , "exn"=>".jpg"),
"gif" => array("create"=>"ImageCreateFromGIF" , "output"=>"imagegif" , "exn"=>".gif"),
"jpeg" => array("create"=>"ImageCreateFromjpeg", "output"=>"imagejpeg" , "exn"=>".jpg"),
"png" => array("create"=>"imagecreatefrompng" , "output"=>"imagepng" , "exn"=>".png"),
"wbmp" => array("create"=>"imagecreatefromwbmp", "output"=>"image2wbmp" , "exn"=>".wbmp")
);$func_create = $all_type[$img_type]['create'];
if(empty($func_create) or !function_exists($func_create)) {
return $returnr;
}
//输出
$func_output = $all_type[$img_type]['output'];
$func_exname = $all_type[$img_type]['exn'];
if(($func_exname=='.gif'||$func_exname=='.png'||$func_exname=='.wbmp')&&!function_exists($func_output)) {
$func_output='imagejpeg';
$func_exname='.jpg';
}
$big_image = $func_create($big_image_name);
$big_width = imagesx($big_image);
$big_height = imagesy($big_image);
if($big_width <= $max_width and $big_height <= $max_height) {
$func_output($big_image, $new_name.$func_exname);
$returnr['file']=$new_name.$func_exname;
$returnr['filetype']=$func_exname;
return $returnr;
}
$ratiow = $max_width / $big_width;
$ratioh = $max_height / $big_height;
$new_width = ($ratiow > 1) ? $big_width : $max_width;
$new_height = ($ratioh > 1) ? $big_height : $max_height;
if($resize == 1) {
if($big_width >= $max_width and $big_height >= $max_height) {
if($big_width > $big_height) {
$tempx = $max_width / $ratioh;
$tempy = $big_height;
$srcX = ($big_width - $tempx) / 2;
$srcY = 0;
} else {
$tempy = $max_height / $ratiow;
$tempx = $big_width;
$srcY = ($big_height - $tempy) / 2;
$srcX = 0;
}
} else {
if($big_width > $big_height){
$tempx = $max_width;
$tempy = $big_height;
$srcX = ($big_width - $tempx) / 2;
$srcY = 0;
} else {
$tempy = $max_height;
$tempx = $big_width;
$srcY = ($big_height - $tempy) / 2;
$srcX = 0;
}
}
}elseif($resize == 2){//同比例缩放超出裁切if($big_width >= $max_width and $big_height >= $max_height){
if($max_width >= ($big_width * $ratioh)){
$tempx=$big_width;
$tempy=$max_height / $ratiow;
$srcX=0;
$srcY=($big_height - $tempy) / 2;
}elseif($max_height >= ( $big_height * $ratiow)){
$tempx=$max_width / $ratioh;
$tempy=$big_height;
$srcX=($big_width - $tempx) / 2;
$srcY=0;
}else{
$tempx=$max_width;
$tempy=$big_height;
$srcX=($big_width - $tempx) / 2;
$srcY=0;
}
}else{
if($max_height >= $big_height){
$tempx=$max_width;
$tempy=$big_height;
$srcX=($big_width - $max_width) / 2;
$srcY=0;
}elseif($max_width >= $big_width){
$tempx=$big_width;
$tempy=$max_height;
$srcX=0;
$srcY=($big_height - $max_height) / 2;
}
}
}elseif($resize == 3){//宽度固定 高度同比例任意
$srcX = 0;
$srcY = 0;
$tempx = $big_width;
$tempy = $big_height;
if($big_width >= $max_width){
$new_height=$big_height*$ratiow;
}else{
$new_height=$big_height;
}
}else { //不保持比例
$srcX = 0;
$srcY = 0;
$tempx = $big_width;
$tempy = $big_height;
}
if(function_exists("imagecopyresampled")){
$temp_image = imagecreatetruecolor($new_width, $new_height);
//echo $tempx;exit;
imagecopyresampled($temp_image, $big_image, 0, 0, $srcX, $srcY, $new_width, $new_height, $tempx, $tempy);
} else {
$temp_image = imagecreate($new_width, $new_height);
imagecopyresized($temp_image, $big_image, 0, 0, $srcX, $srcY, $new_width, $new_height, $tempx, $tempy);
}
/*增加高质量输出图像*/
$zhiliang=$func_exname=='.png'?9:100;
$func_output($temp_image, $new_name.$func_exname,$zhiliang);
//$func_output($temp_image, $new_name.$func_exname);
ImageDestroy($big_image);
ImageDestroy($temp_image);
$returnr['file']=$new_name.$func_exname;
$returnr['filetype']=$func_exname;
return $returnr;
}/*
* 功能:图片加水印 (水印支持图片或文字)
* 参数:
* $groundImage背景图片,即需要加水印的图片,暂只支持GIF,JPG,PNG格式;
* $waterPos水印位置,有10种状态,0为随机位置;
*1为顶端居左,2为顶端居中,3为顶端居右;
*4为中部居左,5为中部居中,6为中部居右;
*7为底端居左,8为底端居中,9为底端居右;
* $waterImage图片水印,即作为水印的图片,暂只支持GIF,JPG,PNG格式;
* $waterText文字水印,即把文字作为为水印,支持ASCII码,不支持中文;
* $textFont文字大小,值为1、2、3、4或5,默认为5;
* $textColor文字颜色,值为十六进制颜色值,默认为#FF0000(红色);
*
* 注意:Support GD 2.0,Support FreeType、GIF Read、GIF Create、JPG 、PNG
* $waterImage 和 $waterText 最好不要同时使用,选其中之一即可,优先使用 $waterImage。
* 当$waterImage有效时,参数$waterString、$stringFont、$stringColor均不生效。
* 加水印后的图片的文件名和 $groundImage 一样。
*/
function imageWaterMark($groundImage,$waterPos=0,$waterImage="",$waterText="",$textFont=5,$textColor="#FF0000",$myfontpath="../data/mask/cour.ttf",$w_pct,$w_quality){
global $fun_r,$editor;
if($editor==1){$a='../';}
elseif($editor==2){$a='../../';}
elseif($editor==3){$a='../../../';}
else{$a='';}
$waterImage=$waterImage?$a.$waterImage:'';
$myfontpath=$myfontpath?$a.$myfontpath:'';
$isWaterImage = FALSE;
$formatMsg = $fun_r['synotdotype'];//读取水印文件
if(!empty($waterImage) && file_exists($waterImage)){
$isWaterImage = TRUE;
$water_info = getimagesize($waterImage);
$water_w= $water_info[0];//取得水印图片的宽
$water_h= $water_info[1];//取得水印图片的高switch($water_info[2]){//取得水印图片的格式
case 1:$water_im = imagecreatefromgif($waterImage);break;
case 2:$water_im = imagecreatefromjpeg($waterImage);break;
case 3:$water_im = imagecreatefrompng($waterImage);break;
default:echo $formatMsg;return "";
}
}//读取背景图片
if(!empty($groundImage) && file_exists($groundImage)) {
$ground_info = getimagesize($groundImage);
$ground_w= $ground_info[0];//取得背景图片的宽
$ground_h= $ground_info[1];//取得背景图片的高switch($ground_info[2]){//取得背景图片的格式
case 1:$ground_im = imagecreatefromgif($groundImage);break;
case 2:$ground_im = imagecreatefromjpeg($groundImage);break;
case 3:$ground_im = imagecreatefrompng($groundImage);break;
default:echo $formatMsg;return "";
}
}else {
echo $fun_r['synotdoimg'];
return "";
}//水印位置
if($isWaterImage){//图片水印
$w = $water_w;
$h = $water_h;
$label = "图片的";
}else{//文字水印
$temp = imagettfbbox(ceil($textFont*2.5),0,$myfontpath,$waterText);//取得使用 TrueType 字体的文本的范围
$w = $temp[2] - $temp[6];
$h = $temp[3] - $temp[7];
unset($temp);
$label = "文字区域";
}
if( ($ground_w<$w) || ($ground_h<$h) ) {
echo $fun_r['sytoosmall'];
return '';
}
switch($waterPos) {
case 0://随机
$posX = rand(0,($ground_w - $w));
$posY = rand(0,($ground_h - $h));
break;
case 1://1为顶端居左
$posX = 0;
$posY = 0;
break;
case 2://2为顶端居中
$posX = ($ground_w - $w) / 2;
$posY = 0;
break;
case 3://3为顶端居右
$posX = $ground_w - $w;
$posY = 0;
break;
case 4://4为中部居左
$posX = 0;
$posY = ($ground_h - $h) / 2;
break;
case 5://5为中部居中
$posX = ($ground_w - $w) / 2;
$posY = ($ground_h - $h) / 2;
break;
case 6://6为中部居右
$posX = $ground_w - $w;
$posY = ($ground_h - $h) / 2;
break;
case 7://7为底端居左
$posX = 0;
$posY = $ground_h - $h;
break;
case 8://8为底端居中
$posX = ($ground_w - $w) / 2;
$posY = $ground_h - $h;
break;
case 9://9为底端居右
$posX = $ground_w - $w;
$posY = $ground_h - $h;
break;
default://随机
$posX = rand(0,($ground_w - $w));
$posY = rand(0,($ground_h - $h));
break;
}//设定图像的混色模式
imagealphablending($ground_im, true);if($isWaterImage){//图片水印
if($water_info[2]==3) {
imagecopy($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h);//拷贝水印到目标文件
}else {
imagecopymerge($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h,$w_pct);//拷贝水印到目标文件
}
}else{//文字水印
if( !empty($textColor) && (strlen($textColor)==7) ) {
$R = hexdec(substr($textColor,1,2));
$G = hexdec(substr($textColor,3,2));
$B = hexdec(substr($textColor,5));
}else {
echo $fun_r['synotfontcolor'];
return "";
}
imagestring ( $ground_im, $textFont, $posX, $posY, $waterText, imagecolorallocate($ground_im, $R, $G, $B));
}//生成水印后的图片
@unlink($groundImage);
switch($ground_info[2]){//取得背景图片的格式
case 1:imagegif($ground_im,$groundImage);break;
case 2:imagejpeg($ground_im,$groundImage,$w_quality);break;
case 3:imagepng($ground_im,$groundImage);break;
default:echo $formatMsg;return "";
}//释放内存
if(isset($water_info)) unset($water_info);
if(isset($water_im)) imagedestroy($water_im);
unset($ground_info);
imagedestroy($ground_im);
}
?>
如下示例代码:
<p><?php<br />define('InEmpireCMSGd',TRUE);</p><p>//原文件,新文件,宽度,高度,维持比例<br />function ResizeImage($big_image_name, $new_name, $max_width = 400, $max_height = 400, $resize = 1){<br /> $returnr['file']='';<br /> $returnr['filetype']='';<br /> if($temp_img_type = @getimagesize($big_image_name)) {preg_match('//([a-z]+)$/i', $temp_img_type[mime], $tpn); $img_type = $tpn[1];<br /> }else{<br /> preg_match('/.([a-z]+)$/i', $big_image_name, $tpn); $img_type = $tpn[1];<br /> }<br /> $all_type = array(<br /> "jpg" => array("create"=>"ImageCreateFromjpeg", "output"=>"imagejpeg" , "exn"=>".jpg"),<br /> "gif" => array("create"=>"ImageCreateFromGIF" , "output"=>"imagegif" , "exn"=>".gif"),<br /> "jpeg" => array("create"=>"ImageCreateFromjpeg", "output"=>"imagejpeg" , "exn"=>".jpg"),<br /> "png" => array("create"=>"imagecreatefrompng" , "output"=>"imagepng" , "exn"=>".png"),<br /> "wbmp" => array("create"=>"imagecreatefromwbmp", "output"=>"image2wbmp" , "exn"=>".wbmp")<br /> );</p><p> $func_create = $all_type[$img_type]['create'];<br /> if(empty($func_create) or !function_exists($func_create)) {<br /> return $returnr;<br /> }<br />//输出<br /> $func_output = $all_type[$img_type]['output'];<br /> $func_exname = $all_type[$img_type]['exn'];<br /> if(($func_exname=='.gif'||$func_exname=='.png'||</p><p>$func_exname=='.wbmp')&&!function_exists($func_output)) {<br /> $func_output='imagejpeg';<br /> $func_exname='.jpg';<br /> }<br /> $big_image = $func_create($big_image_name);<br /> $big_width = imagesx($big_image);<br /> $big_height = imagesy($big_image);<br /> if($big_width <= $max_width and $big_height <= $max_height) {<br /> $func_output($big_image, $new_name.$func_exname);<br /> $returnr['file']=$new_name.$func_exname;<br /> $returnr['filetype']=$func_exname;<br /> return $returnr;<br /> }<br /> $ratiow = $max_width / $big_width;<br /> $ratioh = $max_height / $big_height;<br /> $new_width = ($ratiow > 1) ? $big_width : $max_width;<br /> $new_height = ($ratioh > 1) ? $big_height : $max_height;<br /> if($resize == 1) {<br /> if($big_width >= $max_width and $big_height >= $max_height) {<br /> if($big_width > $big_height) {<br /> $tempx = $max_width / $ratioh;<br /> $tempy = $big_height;<br /> $srcX = ($big_width - $tempx) / 2;<br /> $srcY = 0;<br /> } else {<br /> $tempy = $max_height / $ratiow;<br /> $tempx = $big_width;<br /> $srcY = ($big_height - $tempy) / 2;<br /> $srcX = 0;<br /> }<br /> } else {<br /> if($big_width > $big_height){<br /> $tempx = $max_width;<br /> $tempy = $big_height;<br /> $srcX = ($big_width - $tempx) / 2;<br /> $srcY = 0;<br /> } else {<br /> $tempy = $max_height;<br /> $tempx = $big_width;<br /> $srcY = ($big_height - $tempy) / 2;<br /> $srcX = 0;<br /> }<br /> }<br /> }elseif($resize == 2){//同比例缩放超出裁切</p><p> if($big_width >= $max_width and $big_height >= $max_height){<br /> if($max_width >= ($big_width * $ratioh)){<br /> $tempx=$big_width;<br /> $tempy=$max_height / $ratiow;<br /> $srcX=0;<br /> $srcY=($big_height - $tempy) / 2;<br /> }elseif($max_height >= ( $big_height * $ratiow)){<br /> $tempx=$max_width / $ratioh;<br /> $tempy=$big_height;<br /> $srcX=($big_width - $tempx) / 2;<br /> $srcY=0;<br /> }else{<br /> $tempx=$max_width;<br /> $tempy=$big_height;<br /> $srcX=($big_width - $tempx) / 2;<br /> $srcY=0;<br /> }<br /> }else{<br /> if($max_height >= $big_height){<br /> $tempx=$max_width;<br /> $tempy=$big_height;<br /> $srcX=($big_width - $max_width) / 2;<br /> $srcY=0;<br /> }elseif($max_width >= $big_width){<br /> $tempx=$big_width;<br /> $tempy=$max_height;<br /> $srcX=0;<br /> $srcY=($big_height - $max_height) / 2;<br /> }<br /> }<br /> }elseif($resize == 3){//宽度固定 高度同比例任意<br /> $srcX = 0;<br /> $srcY = 0;<br /> $tempx = $big_width;<br /> $tempy = $big_height;<br /> if($big_width >= $max_width){<br /> $new_height=$big_height*$ratiow;<br /> }else{<br /> $new_height=$big_height;<br /> }<br /> }else { //不保持比例<br /> $srcX = 0;<br /> $srcY = 0;<br /> $tempx = $big_width;<br /> $tempy = $big_height;<br /> }<br /> if(function_exists("imagecopyresampled")){<br /> $temp_image = imagecreatetruecolor($new_width, $new_height);<br /> //echo $tempx;exit;<br /> imagecopyresampled($temp_image, $big_image, 0, 0, $srcX, $srcY, $new_width, $new_height, $tempx, $tempy);<br /> } else {<br /> $temp_image = imagecreate($new_width, $new_height);<br /> imagecopyresized($temp_image, $big_image, 0, 0, $srcX, $srcY, $new_width, $new_height, $tempx, $tempy);<br /> }<br /> /*增加高质量输出图像*/<br /> $zhiliang=$func_exname=='.png'?9:100;<br /> $func_output($temp_image, $new_name.$func_exname,$zhiliang);<br />//$func_output($temp_image, $new_name.$func_exname);<br /> ImageDestroy($big_image);<br /> ImageDestroy($temp_image);<br /> $returnr['file']=$new_name.$func_exname;<br /> $returnr['filetype']=$func_exname;<br /> return $returnr;<br />}</p><p>/*<br />* 功能:图片加水印 (水印支持图片或文字)<br />* 参数:<br />* $groundImage背景图片,即需要加水印的图片,暂只支持GIF,JPG,PNG格式;<br />* $waterPos水印位置,有10种状态,0为随机位置;<br />*1为顶端居左,2为顶端居中,3为顶端居右;<br />*4为中部居左,5为中部居中,6为中部居右;<br />*7为底端居左,8为底端居中,9为底端居右;<br />* $waterImage图片水印,即作为水印的图片,暂只支持GIF,JPG,PNG格式;<br />* $waterText文字水印,即把文字作为为水印,支持ASCII码,不支持中文;<br />* $textFont文字大小,值为1、2、3、4或5,默认为5;<br />* $textColor文字颜色,值为十六进制颜色值,默认为#FF0000(红色);<br />*<br />* 注意:Support GD 2.0,Support FreeType、GIF Read、GIF Create、JPG 、PNG<br />* $waterImage 和 $waterText 最好不要同时使用,选其中之一即可,优先使用 $waterImage。<br />* 当$waterImage有效时,参数$waterString、$stringFont、$stringColor均不生效。<br />* 加水印后的图片的文件名和 $groundImage 一样。<br />*/<br />function imageWaterMark($groundImage,$waterPos=0,$waterImage="",$waterText="",$textFont=5,$textColor="#FF0000",$myfontpath="../data/mask/cour.ttf",$w_pct,$w_quality){<br /> global $fun_r,$editor;<br /> if($editor==1){$a='../';}<br /> elseif($editor==2){$a='../../';}<br /> elseif($editor==3){$a='../../../';}<br /> else{$a='';}<br /> $waterImage=$waterImage?$a.$waterImage:'';<br /> $myfontpath=$myfontpath?$a.$myfontpath:'';<br /> $isWaterImage = FALSE;<br /> $formatMsg = $fun_r['synotdotype'];</p><p>//读取水印文件<br /> if(!empty($waterImage) && file_exists($waterImage)){<br /> $isWaterImage = TRUE;<br /> $water_info = getimagesize($waterImage);<br /> $water_w= $water_info[0];//取得水印图片的宽<br /> $water_h= $water_info[1];//取得水印图片的高</p><p> switch($water_info[2]){//取得水印图片的格式<br /> case 1:$water_im = imagecreatefromgif($waterImage);break;<br /> case 2:$water_im = imagecreatefromjpeg($waterImage);break;<br /> case 3:$water_im = imagecreatefrompng($waterImage);break;<br /> default:echo $formatMsg;return "";<br /> }<br /> }</p><p>//读取背景图片<br /> if(!empty($groundImage) && file_exists($groundImage)) {<br /> $ground_info = getimagesize($groundImage);<br /> $ground_w= $ground_info[0];//取得背景图片的宽<br /> $ground_h= $ground_info[1];//取得背景图片的高</p><p> switch($ground_info[2]){//取得背景图片的格式<br /> case 1:$ground_im = imagecreatefromgif($groundImage);break;<br /> case 2:$ground_im = imagecreatefromjpeg($groundImage);break;<br /> case 3:$ground_im = imagecreatefrompng($groundImage);break;<br /> default:echo $formatMsg;return "";<br /> }<br /> }else {<br /> echo $fun_r['synotdoimg'];<br /> return "";<br /> }</p><p>//水印位置<br /> if($isWaterImage){//图片水印<br /> $w = $water_w;<br /> $h = $water_h;<br /> $label = "图片的";<br /> }else{//文字水印<br /> $temp = imagettfbbox(ceil($textFont*2.5),0,$myfontpath,$waterText);//取得使用 TrueType 字体的文本的范围<br /> $w = $temp[2] - $temp[6];<br /> $h = $temp[3] - $temp[7];<br /> unset($temp);<br /> $label = "文字区域";<br /> }<br /> if( ($ground_w<$w) || ($ground_h<$h) ) {<br /> echo $fun_r['sytoosmall'];<br /> return '';<br /> }<br /> switch($waterPos) {<br /> case 0://随机<br /> $posX = rand(0,($ground_w - $w));<br /> $posY = rand(0,($ground_h - $h));<br /> break;<br /> case 1://1为顶端居左<br /> $posX = 0;<br /> $posY = 0;<br /> break;<br /> case 2://2为顶端居中<br /> $posX = ($ground_w - $w) / 2;<br /> $posY = 0;<br /> break;<br /> case 3://3为顶端居右<br /> $posX = $ground_w - $w;<br /> $posY = 0;<br /> break;<br /> case 4://4为中部居左<br /> $posX = 0;<br /> $posY = ($ground_h - $h) / 2;<br /> break;<br /> case 5://5为中部居中<br /> $posX = ($ground_w - $w) / 2;<br /> $posY = ($ground_h - $h) / 2;<br /> break;<br /> case 6://6为中部居右<br /> $posX = $ground_w - $w;<br /> $posY = ($ground_h - $h) / 2;<br /> break;<br /> case 7://7为底端居左<br /> $posX = 0;<br /> $posY = $ground_h - $h;<br /> break;<br /> case 8://8为底端居中<br /> $posX = ($ground_w - $w) / 2;<br /> $posY = $ground_h - $h;<br /> break;<br /> case 9://9为底端居右<br /> $posX = $ground_w - $w;<br /> $posY = $ground_h - $h;<br /> break;<br /> default://随机<br /> $posX = rand(0,($ground_w - $w));<br /> $posY = rand(0,($ground_h - $h));<br /> break;<br /> }</p><p>//设定图像的混色模式<br /> imagealphablending($ground_im, true);</p><p> if($isWaterImage){//图片水印<br /> if($water_info[2]==3) {<br /> imagecopy($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h);//拷贝水印到目标文件<br /> }else {<br /> imagecopymerge($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h,$w_pct);//拷贝水印到目标文件<br /> }<br /> }else{//文字水印<br /> if( !empty($textColor) && (strlen($textColor)==7) ) {<br /> $R = hexdec(substr($textColor,1,2));<br /> $G = hexdec(substr($textColor,3,2));<br /> $B = hexdec(substr($textColor,5));<br /> }else {<br /> echo $fun_r['synotfontcolor'];<br /> return "";<br /> }<br /> imagestring ( $ground_im, $textFont, $posX, $posY, $waterText, imagecolorallocate($ground_im, $R, $G, $B));<br /> }</p><p>//生成水印后的图片<br /> @unlink($groundImage);<br /> switch($ground_info[2]){//取得背景图片的格式<br /> case 1:imagegif($ground_im,$groundImage);break;<br /> case 2:imagejpeg($ground_im,$groundImage,$w_quality);break;<br /> case 3:imagepng($ground_im,$groundImage);break;<br /> default:echo $formatMsg;return "";<br /> }</p><p>//释放内存<br /> if(isset($water_info)) unset($water_info);<br /> if(isset($water_im)) imagedestroy($water_im);<br /> unset($ground_info);<br /> imagedestroy($ground_im);<br />}<br />?></p>
免责/版权声明:
1、所有来源标注为 ECMSPLUS /zwcms.com的内容版权均为本站所有,若您需要引用、转载,只需要注明来源及原文链接即可,如涉及大面积转载,请来信告知,获取授权。
2、本站所提供的文章资讯、软件资源、素材源码等内容均为作者提供、网友推荐、互联网整理而来(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考,如有侵犯您的版权,请联系我们,本站将在三个工作日内改正。
3、若您的网站或机构从本站获取的一切资源进行商业使用,除来源为本站的资料需与本站协商外,其他资源请自行联系版权所有人。
4、 ECMSPLUS /zwcms.com不保证资源的准确性、安全性和完整性,请您在阅读、下载及使用过程中自行确认,本站亦不承担上述资源对您或您的网站造成的任何形式的损失或伤害
5、未经 ECMSPLUS /zwcms.com允许,不得盗链、盗用本站资源;不得复制或仿造本网站,不得在非 ECMSPLUS /zwcms.com所属的服务器上建立镜像, ECMSPLUS /zwcms.com对其自行开发的或和他人共同开发的所有内容、技术手段和服务拥有全部知识产权,任何人不得侵害或破坏,也不得擅自使用。
6、互联网的本质是自由与分享,我们真诚的希望,每一份有价值的正能量能够在互联网中自由传播,能够为每一个网站提供动力。
评论(3)
欢迎您光临1pma.cn,本站秉承服务宗旨 履行“站长”责任,销售只是起点 服务永无止境!
?
?普通用户