<?php Header( "Content-type: image/gif"); // info for the browser
/* PHP3 Button generator, (c) 2000 by IzzySoft ([email protected])
" /> 黄页免费观看,儿媳妇完整版视频播放免费观看,国产精品人妻系列21P

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

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

通過文字傳遞創建的圖形按鈕,詳細說明請看文內英文說明
<?php Header( "Content-type: image/gif"); // info for the browser
    /* php3 Button generator, (c) 2000 by IzzySoft ([email protected])
    * 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
    ?>         

php技術通過文字傳遞創建的圖形按鈕,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 99re久久热在线播放快 | 九九热国产视频 | 老师扒开尿口男生摸尿口 | 麻豆高清区在线 | 美女白虎穴 | 亚洲国产第一 | 妓女嫖客叫床粗话对白 | 国产精品久人妻精品 | 亚欧日韩毛片在线看免费网站 | 最近在线视频观看2018免费 | 动漫美女人物被黄漫在线看 | 99精品在线看 | 亚洲三级黄色片 | 久久AV喷吹AV高潮欧美 | 无人区免费一二三四乱码 | 538久久视频在线 | 小草视频免费观看在线 | 色久悠悠无码偷拍自怕 | 午夜在线视频国产极品片 | 中国jjzz| 国产a级黄色毛片 | 欧美激情一区二区三区视频 | 亚洲中文在线偷拍 | 琪琪电影午夜理论片77网 | 麻豆一二三区果冻 | 中文字幕人妻无码系列第三区 | 好姑娘BD高清在线观看免费 | 99精品在线看| 国产乱妇乱子在线播视频播放网站 | 亚洲精品午夜VA久久成人 | 精品久久久久久无码人妻国产馆 | 四虎精品久久久久影院 | 久久AAAA片一区二区 | 两个人的视频免费 | 99影视久久电影网久久看影院 | 九九热在线视频观看这里只有精品 | 97精品国产自产在线观看永久 | 国产成人精品123区免费视频 | 国产欧美国日产在线播放 | 欧美97色伦综合网 | 欧美日韩国产码在线 |