亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

通過文字傳遞創建的圖形按鈕

2019-11-18 21:21:58
字體:
來源:轉載
供稿:網友
通過文字傳遞創建的圖形按鈕,詳細說明請看文內英文說明
<?php Header( "Content-type: image/gif"); // info for the browser
    /* PHP3 Button generator, (c) 2000 by IzzySoft (izzysoft@buntspecht.de)
    * License: GPL (and it would be nice to drop me a note that you find it
    * useful - if you use it. And, of course, I am very interested in
    * enhancements you made to the script!
    *
    * Purpose: generate buttons with text passed by parameter.
    *
    * possible parameters to the script:
    *button- input gif image. Just the part of the filename before the dot.
    *The specified image file is expected in the same directory
    *as this script resides in.
    *font - font to use (1 - 5; 1 is very small, 3 medium, 5 normal size.
    *The script will automatically use a smaller font if text is
    *too long for selected size.) Default: 5
    *text - the text to be put on the button. Will be centered.
    *textcolor - color for the letters. Default: white.
    *in this example code only blue, white and black are defined;
    *but you can add custom colors easily.
    *width,heigth - width and heigth of the button. Useful only if target
    *button should have different size than source image.
    *
    * Example for usage:
    * <IMG SRC="button.php3?button=yellow&text=Example">
    * will look for yellow.gif and put the string "Example" on it.
    *
    * I use to have three buttons I normally generate (one displays selected
    * item, one is for mouSEOver(), and one is the default button). The source
    * images are yellow.gif, white.gif and blue.gif - so my script assumes
    * blue.gif as default if "button=" not specified - you may wish to change
    * this below, it's easy ;)
    */
    // ===========================[ check fo
    //     r parameters and/or set defaults ]===
    if (($font == "") || ($font > 5) || ($font < 1)) { $font = 5; }
    if ($text == "") { $text="Moin!"; }// button text
    if ($textcolor == "") {// color for the letters
    switch ($button) {
    case "yellow":
    case "white":
    $textcolor = "black";
    break;
    default:
    if ($button == "") { $button = "blue"; }
    $textcolor = "white";
    break;
    }
    } // textcolor end
    $im_info = getimagesize("$button.gif"); // button size
    if ($width == "") {
    if ($im_info == "") {
    $buttonwidth = 125;
    } else {
    $buttonwidth = "$im_info[0]";
    }
    } else {
    $buttonwidth = $width;
    }
    if ($heigth == "") {
    if ($im_info == "") {
    $buttonheigth = 30;
    } else {
    $buttonheigth = "$im_info[1]";
    }
    } else {
    $buttonheigth = $heigth;
    }
    $vmidth = ceil($buttonheigth / 2);
    // =====================================
    //     ===[ now lets define some colors ]===
     
    $white = "255,255,255";
    $black = "0,0,0";
    $blue = "0x2c,0c6d,0xaf";
    // =====================================
    //     =============[ build color array ]===
    // now we put the needed color into an a
    //     rray (if e.g. "$textcolor=white",
    // the array $textcolor_array rePResents
    //     "white")
    $textcolor_array = explode(",", $$textcolor);
    // =======================[ calculate po
    //     sition of the text on the button ]===
    do {
    $textwidth = strlen($text) * imagefontwidth($font);
    $x = ($buttonwidth - $textwidth) / 2; $x = ceil($x);
    $y = $vmidth - (imagefontheight($font) / 2);
    $font--;
    } while (($x < 0) && ($font > 0)); $font++;
    // =====================================
    //     ======[ now we create the button ]===
    if (isset($width) || isset($heigth)) {// size change expected?
    $ima = imagecreatefromgif("$button.gif");// open input gif
    $im = imagecreate($buttonwidth,$buttonheigth); // create img in desired size
    $uglybg = ImageColorAllocate($im,0xf4,0xb2,0xe5);
    ImageRectangle($im,0,0,$buttonwidth,$buttonheigth,$uglybg);
    $dummy = imagecopyresized($im,$ima,0,0,0,0,$buttonwidth,$buttonheigth,$im_info[0],$im_info[1]);
    if ($dummy == "") {
    ImageDestroy($im); // if it didn't work, create default below instead
    } else {;}
    ImageDestroy($ima);
    ImageColorTransparent($im,$uglybg);
    } else {
    $im = imagecreatefromgif("$button.gif");// open input gif
    }
    if ($im == "") { $im = imagecreate($buttonwidth,$buttonheigth); // if input gif not found,
    $rblue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);// create a default box
    ImageRectangle($im,0,0,200,100,$rblue);
    }
    $color = ImageColorAllocate($im, $textcolor_array[0], $textcolor_array[1], $textcolor_array[2]); // allocate the color
    imagestring($im, $font, $x, $y, "$text", $color); // put the text on it
    ImageGif($im);// send button to browser
    ImageDestroy($im);// free the used memory
    ?>         
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
精品人伦一区二区三区蜜桃网站| 最近2019年好看中文字幕视频| 黄网动漫久久久| 久久综合网hezyo| 成人在线精品视频| 欧美日韩黄色大片| 亚洲综合大片69999| 午夜精品视频在线| 中文字幕欧美视频在线| 国产精品第一视频| 久久久久久69| 亚洲二区在线播放视频| 国产精品av网站| 国产一区二区动漫| 国产精品第七十二页| 精品一区二区三区四区在线| 欧美日韩激情小视频| 久久免费福利视频| 中文字幕一区二区三区电影| 亚洲第一区在线观看| 亚洲视频在线观看网站| 久久久久久免费精品| 自拍偷拍亚洲一区| 国产精品视频免费观看www| 日韩在线视频观看正片免费网站| 欧美资源在线观看| 国产精品久久久久久久av电影| 欧美寡妇偷汉性猛交| 日韩免费av一区二区| 欧美高清视频在线| 91高清免费在线观看| 91中文在线观看| 亚洲综合中文字幕在线观看| 日韩在线观看视频免费| 国产精品日日做人人爱| 亚洲精品欧美一区二区三区| 久久久久久国产精品美女| 国产精品91久久久久久| 欧美区二区三区| 欧美裸身视频免费观看| 欧美性受xxxx白人性爽| 成人国产精品色哟哟| 青草青草久热精品视频在线观看| 欧美xxxx做受欧美| 亚洲香蕉成人av网站在线观看| 一区二区三区高清国产| 国产精品美女网站| 国产精品日韩欧美大师| 超碰日本道色综合久久综合| 亚洲一二三在线| 色黄久久久久久| 中文字幕亚洲欧美日韩2019| 91国产在线精品| 欧美精品精品精品精品免费| 欧美日韩国产一区二区三区| 国产日韩欧美自拍| 国产日韩欧美另类| 欧美一级片久久久久久久| 亚洲xxxxx| 欧美在线欧美在线| 欧美激情第99页| 国产精品综合网站| 欧美韩日一区二区| 欧美国产日韩xxxxx| 精品久久久999| 欧美孕妇与黑人孕交| 蜜臀久久99精品久久久无需会员| 亚洲www视频| 粉嫩av一区二区三区免费野| 欧美精品一区二区三区国产精品| 欧美性色19p| 国产亚洲精品久久久久久牛牛| 国产精品吴梦梦| 亚洲美女视频网站| 欧美国产日韩一区| 亚洲欧美制服综合另类| 亚洲精品98久久久久久中文字幕| 亚洲日本中文字幕免费在线不卡| 欧美成aaa人片在线观看蜜臀| 国产欧美久久一区二区| 18久久久久久| 91免费欧美精品| 91久久精品日日躁夜夜躁国产| 91在线视频一区| 国产精品久久久久国产a级| 在线精品播放av| xxxx欧美18另类的高清| 国产亚洲在线播放| 久久高清视频免费| 亚洲国产精品va在线观看黑人| 国产精品私拍pans大尺度在线| 欧美久久久精品| 亚洲成色777777在线观看影院| 成人妇女免费播放久久久| 777国产偷窥盗摄精品视频| 亚洲欧美激情在线视频| 在线视频国产日韩| 欧美电影《睫毛膏》| 国产精品青青在线观看爽香蕉| 国产精品久久久久久久午夜| 欧美人在线视频| 91精品国产99久久久久久| 国产精品手机播放| 国产91露脸中文字幕在线| 欧美大片在线影院| 日韩亚洲一区二区| 日韩视频欧美视频| 欧美另类极品videosbestfree| 69影院欧美专区视频| 在线播放亚洲激情| 日本精品久久久久影院| 国外成人在线直播| 成人国产精品av| 搡老女人一区二区三区视频tv| 国产精品免费看久久久香蕉| 在线成人免费网站| 一区二区在线视频播放| 欧美乱妇高清无乱码| 欧美精品九九久久| 欧美高清性猛交| 92裸体在线视频网站| 美女福利视频一区| 日本久久中文字幕| 欧美影院在线播放| 午夜精品久久久久久久99黑人| 4438全国成人免费| 国产精品激情av电影在线观看| 久久久国产精品免费| 亚洲美女视频网站| 成人免费看吃奶视频网站| 欧美电影免费观看网站| 国语自产精品视频在线看抢先版图片| 欧美亚洲激情在线| 最近2019年中文视频免费在线观看| 国产精品久久久久影院日本| 欧美又大又粗又长| 成人av在线天堂| 97婷婷涩涩精品一区| 国产亚洲成精品久久| 欧美人成在线视频| 国产精品日日做人人爱| 午夜精品久久久久久久白皮肤| 欧美日韩一区二区在线| 亚州av一区二区| 日韩免费黄色av| 2019精品视频| 久久在线精品视频| 97不卡在线视频| 91久久国产综合久久91精品网站| 日本19禁啪啪免费观看www| 亚洲人在线视频| 国自产精品手机在线观看视频| 日韩精品免费在线| 97在线观看免费| 日韩视频在线观看免费| 亚洲香蕉在线观看| 日韩中文字幕网| 国产亚洲免费的视频看| 麻豆国产精品va在线观看不卡| 国产一区二区在线免费视频| 色综合视频一区中文字幕| 亚洲男人的天堂网站| 91精品久久久久久久久青青| 亚洲一区二区国产|