示例#1
0
     list($s_text_r, $s_text_g, $s_text_b) = getHexColors($text_color_2);
 }
 $textcolor = ImageColorAllocate($img, $text_r, $text_g, $text_b);
 $secondaryTextColor = ImageColorAllocate($img, $s_text_r, $s_text_g, $s_text_b);
 ImageFill($img, 0, 0, $black);
 $base_r = 0;
 $base_g = 0;
 $base_b = 0;
 $dest_r = 0;
 $dest_g = 120;
 $dest_b = 255;
 if ($color_1) {
     list($base_r, $base_g, $base_b) = getHexColors($color_1);
 }
 if ($color_2) {
     list($dest_r, $dest_g, $dest_b) = getHexColors($color_2);
 }
 for ($i = 0; $i < ImageSY($img); $i++) {
     $r = min($base_r + ($dest_r - $base_r) / ImageSY($img) * $i, 255);
     $g = min($base_g + ($dest_g - $base_g) / ImageSY($img) * $i, 255);
     $b = min($base_b + ($dest_b - $base_b) / ImageSY($img) * $i, 255);
     $c = ImageColorAllocate($img, $r, $g, $b);
     ImageLine($img, 0, $i, ImageSX($img), $i, $c);
     ImageColorDeallocate($img, $c);
 }
 $offset = 3;
 ImageFilledRectangle($img, $offset, $offset, ImageSX($img) - $offset - 1, ImageSY($img) - $offset - 1, $blacka);
 ImageRectangle($img, $offset, $offset, ImageSX($img) - $offset - 1, ImageSY($img) - $offset - 1, $blacka);
 if ($img_array[1] == 0) {
     $new_width = 0;
 } else {
 ImageFilledRectangle($img, $offset_2, 5 * $offset_2 + 2, ImageSX($img) - 18 * $offset_2, ImageSY($img) - $offset_2, $bg_alfa);
 // положение внутренненго блока
 ImageRectangle($img, $offset_2, 5 * $offset_2 + 2, ImageSX($img) - 18 * $offset_2, ImageSY($img) - $offset_2, $bg_colorAlpha);
 // контур внутреннего блока
 ImageFilledRectangle($img, 33 * $offset_1, $offset_1, ImageSX($img) - $offset_1, ImageSY($img) - $offset_1, $bg_alfa);
 // положение внутренненго блока
 ImageRectangle($img, 33 * $offset_1, $offset_1, ImageSX($img) - $offset_1, ImageSY($img) - $offset_1, $bg_colorAlpha);
 // контур внутреннего блока
 ImageRectangle($img, 0, 0, ImageSX($img), ImageSY($img), $bg_color);
 // окантовка всей картинки
 /////////////////////////////////////
 $text_color_1 = $text_color['in_block'];
 // цвет всех надписей в блоках - пойже будет разбит на несколько цветов
 // отвечает за цвет текста
 list($text_r, $text_g, $text_b) = getHexColors($text_color_1);
 list($s_text_r, $s_text_g, $s_text_b) = getHexColors($text_color_2);
 $textcolor = ImageColorAllocate($img, $text_r, $text_g, $text_b);
 $secondaryTextColor = ImageColorAllocate($img, $s_text_r, $s_text_g, $s_text_b);
 /* пихаем текст */
 ImageTTFText($img, 12, 0, 9, 22, $secondaryTextColor, $mainFont, $server['name']);
 ImageTTFText($img, 8, 0, 9, 40, $textcolor, $mainFont, win2uni("Альянс: " . $count[1] . " (" . $online[1] . " онлайн)"));
 ImageTTFText($img, 8, 0, 9, 54, $textcolor, $mainFont, win2uni("Орда: " . $count[2] . " (" . $online[2] . " онлайн)"));
 ImageTTFText($img, 8, 0, 9, 68, $textcolor, $mainFont, win2uni("Всего: " . $count[0] . " (" . $online[0] . " онлайн)"));
 ImageTTFText($img, 8, 0, 190, 18, $textcolor, $mainFont, win2uni("Рейты"));
 ImageTTFText($img, 8, 0, 170, 30, $textcolor, $mainFont, win2uni("Квесты: " . $rates['quest']));
 ImageTTFText($img, 8, 0, 170, 42, $textcolor, $mainFont, win2uni("Хонор: " . $rates['honor']));
 ImageTTFText($img, 8, 0, 170, 54, $textcolor, $mainFont, win2uni("Мобы: " . $rates['npc']));
 ImageTTFText($img, 8, 0, 170, 66, $textcolor, $mainFont, win2uni("Дроп: " . $rates['drop']));
 header("Content-disposition: inline; filename=\"status.png\"");
 header("content-type: image/png");
 header("cache-control: max-age=86400");