很好的功能,只是不能用,楼主再看看,
只要加- // 实现黑底白字
- function images_test($path,$uid=1){
- if(is_file($path) === false)
- return false;
- $logoimage = $path;
- $logoimg = getimagesize($logoimage);
- if($logoimg[0]<=190)
- return false;
- switch ($logoimg[2]) {
- case 1 :
- $in = imagecreatefromgif($logoimage);
- break;
- case 2 :
- $in = imagecreatefromjpeg($logoimage);
- break;
- case 3 :
- $in = imagecreatefrompng($logoimage);
- break;
- }
- $height = 22;
- $length = (int) $logoimg[0];
- $im = imagecreatetruecolor($length,$height);
-
- $red = imagecolorallocate($im,255,255,255); //背景色
- $red2 = imagecolorallocate($im,109,109,109); //文字的颜色
- imageline($im,0,0,$length,0,$red2);
- $font = 'http://www.adjia.com/'.$uid; 黑底上的文字
- imagestring($im,4,$length/2-(strlen($font)/2),3,$font,$red);
- imagecopy($in,$im, 0,$logoimg[1]-$height, 0, 0, $logoimg[0], $logoimg[1]);
- switch ($logoimg[2]) {
- case 1 :
- imagegif($in,$path);
- break;
- case 2 :
- imagejpeg($in,$path);
- break;
- case 3 :
- imagepng($in,$path);
- break;
- }
- }
复制代码 所有网页打开都是空白了 |