> 0x10; break; case "g": return 0xFF & ($int >> 0x8); break; case "b": return 0xFF & $int; break; default: return array( "r" => 0xFF & $int >> 0x10, "g" => 0xFF & ($int >> 0x8), "b" => 0xFF & $int ); break; } } if($_GET['start']=="5glive"){ $filename = "images/sample.png"; $type = 1; }elseif($_GET['show']){ $picname = $_GET['show']; $filename = $picdir."/".date("ymd",$picname)."/".$picname.".png"; $type = 2; }elseif($_GET['down']){ $filename = $_GET['down']; header("Content-type: command"); header("Content-Disposition: attachment; filename=gramik.pl_emaillogo.png"); readfile($picdir."/".date("ymd",$filename)."/".$filename.".png"); exit; }elseif($_GET['mkpic']=="5glive"){ $username = trim($_GET['s']); //ÓʼþµØÖ· if(ereg("^[0-9a-zA-Z\_@.]*$",$username) && $username){ $host = $_GET['maillogo']; //ÓʼþHOST $srcUrl = "s_logo/".$host.".gif"; //EmailͼƬURL $back_c = "#ffffff"; //±³¾°ÑÕÉ« $border_c = $_GET['bordercolor']; //±ß¿òÑÕÉ« $font_c = $_GET['color']; //ÎÄ×ÖÑÕÉ« $font_size = $_GET['size']; //×ÖÌå´óС $font_url = "s_font/".$_GET['mailfont'].".ttf"; //×ÖÌåURL if($_GET['border']=="true") $is_border = 1; else $is_border = 0; //ÊÇ·ñÓб߿ò 0ûÓÐ ·Ç0ÓÐ if($host) $is_logo = 1; else $is_logo=0; //ÊÇ·ñÓÐÓÊÏäͼ±ê 0ûÓÐ ·Ç0ÓÐ $srcWidth = 0; $srcHeight = 0; $str_pos = imagettfbbox($font_size,0,$font_url,$username); $str_width = intval($str_pos[2]); //ÎÄ×Ö×Ö·û¿í¶È $str_height = intval(str_replace("-","",$str_pos[5])); //ÎÄ×Ö×Ö·û¸ß¶È if($is_logo){ $origImg = ImageCreateFromGIF($srcUrl); $srcWidth = intval(imagesx($origImg)); //EmailͼÏñ¿í¶È $srcHeight = intval(imagesy($origImg)); //EmailͼÏñ¸ß¶È } $newWidth = $str_width + 15 + $srcWidth; //LOGO×Ü¿í¶È $newHeight = ($srcHeight>$str_height) ? $srcHeight+2 : $str_height+8; $image=imagecreatetruecolor($newWidth, $newHeight); //´´½¨Í¼Æ¬ $back_color = hexrgb($back_c,rgb); //È¡±³¾°ÑÕÉ« $back = imagecolorallocate($image, $back_color['r'], $back_color['g'], $back_color['b']); //±³¾°ÑÕÉ« °×É« imagefilledrectangle($image, 0, 0, $newWidth - 1, $newHeight - 1, $back); //±³¾°Ìî³ä if($is_border){ $border_color = hexrgb($border_c,rgb); //È¡±ß¿òÑÕÉ« $border = imagecolorallocate($image, $border_color['r'], $border_color['g'], $border_color['b']); //±ß¿òÑÕÉ« imagerectangle($image, 0, 0, $newWidth - 1, $newHeight - 1, $border); //»­±ß¿ò } if($is_logo){ $srcX = $str_width+10; //EmailͼƬXÖáλÖà $srcY = ($newHeight - $srcHeight)/2; //EmailͼƬYÖáλÖà ImageCopy($image, $origImg, $srcX,$srcY,0,0,$srcWidth,$srcHeight); //½«EmailͼƬ¸´ÖƵ½LOGOÉÏ } $font_color = hexrgb($font_c,rgb); //È¡×ÖÌåÑÕÉ« $color = imagecolorallocate($image, $font_color['r'], $font_color['g'], $font_color['b']); //×ÖÌåÑÕÉ« $str_x = $str_height+($newHeight-$str_height)/2; if(!$is_logo) $str_x-=2; //×ÖÌå¸ß¶ÈÐÞÕý imagettftext($image, $font_size, 0, 6, $str_x, $color, $font_url, $username); //½«ÎÄ×Öдµ½Í¼Æ¬ÉÏ //Êä³öͼƬ $filename = time(); $filedir = date("ymd",$filename); if(!file_exists($picdir."/".$filedir)){ //Éú³ÉͼƬ´æ´¢Ä¿Â¼£¬°´Ô·ݷֿª´æ´¢ mkdir($picdir."/".$filedir); } header("Content-type: image/png"); imagepng($image,$picdir."/".$filedir."/".$filename.".png"); //Èç¹ûÒª½«Í¼Æ¬´æÔÚ±¾µØ£¬´ò¿ª´ËÑ¡Ïî imagedestroy($image); header("location: ?show=".$filename); exit; }elseif($username==""){ $filename = "images/error.png"; $type = 4; }else{ $filename = "images/error.png"; $type = 4; } }else{ $filename = "images/error.png"; $type = 4; } ?> Gramik.pl email signature generator
ÑÇÈØ ãÈÇÔÑ
HTML ßÜæÏ