国产激情自拍_国产9色视频_丁香花在线电影小说观看 _久久久久国产精品嫩草影院

首頁 > 編程 > PHP > 正文

通過文字傳遞創(chuàng)建的圖形按鈕

2019-09-08 23:11:50
字體:
供稿:網(wǎng)友
通過文字傳遞創(chuàng)建的圖形按鈕,詳細(xì)說明請(qǐng)看文內(nèi)英文說明
<?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
   ?>/t
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
国产激情自拍_国产9色视频_丁香花在线电影小说观看 _久久久久国产精品嫩草影院
伊人永久在线| 国产麻豆精品视频一区二区| 99re6在线视频精品免费| 日韩亚洲一区中文字幕| 国产麻豆一级片| 国产区卡一卡二卡三乱码免费| 97影院理论午夜| 国产主播福利在线| 伊人伊人av电影| 天天操天天是| www狠狠操| www免费在线观看视频| 国产69久久| 精品黄色免费中文电影在线播放| 在线āv视频| 伊人影院在线视频| gogo在线观看| 国产精品区一区二| 国产精品福利视频一区二区三区| 国产一级二级在线| 精品日韩av| 久草视频国产| 99视频在线观看地址| 日本中文字幕视频| 在线中文字幕资源| 成人超碰在线| 在线免费观看你懂的| 国产一级黄色大片| 青青青国产视频| 国产卡1卡2卡三卡在线| 国产激情网址| 国产麻豆精品视频一区二区| 99热免费在线| 国产精品久久久久白浆| jizz在线视频| 亚洲字幕成人中文在线观看| 国产亚洲精品久久久久久青梅| heisi视频网在线观看| 精品欧美色视频网站在线观看| japanese色国产在线看视频| 国产成人无吗| 国产精品久久一区二区三区不卡| 操人视频91| 免费看的av| 免费国产视频| 免费高清av| 四虎一区二区三区| 伊人免费在线| 91桃色在线| 中文字幕2019第三页| 精品51国产黑色丝袜高跟鞋| 国产对白国语对白| 国产经典三级在线| 国产精品二线| 国产精品186在线观看在线播放 | 中文字幕乱在线伦视频乱在线伦视频 | 亚洲欧美自拍另类| 97最新国自产拍视频在线完整在线看| 国产网红女主播精品视频| 国产呻吟对白刺激无套视频在线| 中文字幕在线视频网| 高潮白浆视频| 国产精品一区二区婷婷| 99热最新网址| 国产黄色免费网| 亚洲精品一区中文字幕电影| www在线视频| 综合图区亚洲白拍在线| 2018狠狠干| 麻豆精品免费视频入口| 国产麻豆精品入口在线观看| 国产视频一二| eeuss影影院www在线播放| 国产免费av在线| 中文av字幕| 中文字幕在线视频观看| 国产福利免费在线观看| 亚洲xxxxxx| 丁香花高清视频完整版在线观看| 国产一二三区精品视频| 日本a级黄色| 国产精品视频h| 狠狠狠狠狠狠操| 中文在线视频| 国产极品美女到高潮| 欧美卡一卡二| av一级在线| 精精国产xxxx视频在线动漫| 国产探花视频在线观看| wwww亚洲| 四虎精品成人a在线观看| 18 激情视频在线| 黄色av免费看| 九九热视频免费在线观看| 精品国产高清a毛片无毒不卡| 国产网站在线播放| 国产一二在线观看| 中文字幕高清av| 国产女人在线观看| 成人精品一区二区三区免费| 九九热视频在线| 狠狠色综合久久婷婷| 免费三级毛片| 免费在线高清av| 狠狠干在线视频| 福利在线视频导航| 91超碰在线免费| 麻豆视频在线观看免费网站| 久久国产精品久久久久久小说| 四虎影视成人永久免费观看视频| 亚洲成人国产综合| 欧美精品另类| 午夜在线小视频| 国产精品冒白浆免费视频| 国产黄色av免费看| 999福利在线视频| 99在线播放| japanese色国产在线看视频| www在线观看播放免费视频日本| 日本免费一二区| 狠狠操五月天| 国产精品国精产品一二| 国产精品美女视频免费观看软件 | 久热国产在线视频| 九九热视频在线| 精品成人一区二区三区免费视频| 亚洲成人福利| 最近中文字幕mv2018在线高清 | 亚洲第一成人在线视频| 蜜桃av网站| 国产福利片在线| 九色在线网站| 国产精品伦一区二区三区级视频频 | 在线久久视频| 麻豆精品不卡国产免费看| 国产高清大尺度一区二区不卡| 精品偷拍激情视频在线观看| 九色福利视频| 亚洲欧美日韩一区成人| 国产视频你懂的| 激情丁香婷婷| 在线观看的网站你懂的| 午夜av在线免费观看| 日韩中文字幕久久久经典网| 国产视频一二| 国产卡一卡二卡三| 欧洲一区av| 伊人永久在线| 精品久久亚洲一级α| 五月综合激情在线| 国产中文字幕在线| а√天堂8资源在线官网| 国产青草视频在线观看视频| 国产在线观看18| 青青草观看免费视频在线| 在线免费观看你懂的| 国产精品乱码一区二区三区视频| 交视频在线观看国产| 欧美日韩亚洲第一页| 先锋影音av中文字幕| 尤物视频在线观看视频| 精品无人乱码| 在线观看av中文| 亚洲第一区视频| 日本欧洲一区| 玖玖在线视频| 国产精选在线观看| 国产理论在线观看| 国产高清在线| av在线free| 黄色av网站在线免费观看| 老鸭窝av在线| 99视频在线观看地址| 尤物网在线观看| 国产一起色一起爱| 国产精品yjizz视频网一二区| 国产污污在线观看| 亚洲视频网站在线| 麻豆精品视频入口| 国产欧美日本亚洲精品一4区| 国产成人综合亚洲欧美在| av大片在线播放| 九九热免费在线视频| 国产精品人人爱一区二区白浆| 中文在线视频| 国产麻豆精品入口在线观看| 91看片在线观看| 欧美视频免费一区二区三区| 中文字幕在线观看播放| 国产不卡在线| 久久久久久久久免费视频| 最新天堂资源在线资源| 亚洲一本大道| 7777在线| 国产男女猛烈无遮挡免费视频| 国产第一页在线视频| 豆国产97在线|亚洲| 一本大道久久a久久精品| 国产一级视频| 国产麻豆综合视频在线观看|