示例#1
0
function Clean_Circular_Diagram($ImageHandle, $background_color, $diameter, $centerX, $centerY)
{
    $dec = ReColor($background_color);
    $color = ImageColorAllocate($ImageHandle, $dec[0], $dec[1], $dec[2]);
    for ($i = 0; $i <= $diameter; $i++) {
        imagearc($ImageHandle, $centerX, $centerY, $diameter + $i, $diameter + $i, 0, 360, $color);
    }
}
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/tools.php";
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/support/colors.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/img.php";
if (function_exists("FormDecode")) {
    FormDecode();
}
UnQuoteAll();
// создаем изображение
$ImageHendle = CreateImageHandle(45, 2);
$dec = ReColor(isset($color) ? $color : '00000');
$color = ImageColorAllocate($ImageHendle, $dec[0], $dec[1], $dec[2]);
if (isset($dash) && $dash == "Y") {
    $style = array($color, $color, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT);
    //$white = ImageColorAllocate($ImageHendle,255,255,255);
    //$style = array ($color,$color,$white,$white,$white);
    ImageSetStyle($ImageHendle, $style);
    ImageLine($ImageHendle, 3, 0, 40, 0, IMG_COLOR_STYLED);
    ImageLine($ImageHendle, 1, 1, 40, 1, IMG_COLOR_STYLED);
} else {
    ImageLine($ImageHendle, 0, 0, 44, 0, $color);
    ImageLine($ImageHendle, 0, 1, 44, 1, $color);
}
/******************************************************
                ќтображаем изображение
*******************************************************/
ShowImageHeader($ImageHendle);
示例#3
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/tools.php";
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/advertising/colors.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/img.php";
if (function_exists("FormDecode")) {
    FormDecode();
}
UnQuoteAll();
// создаем изображение
$ImageHendle = CreateImageHandle(45, 2);
$dec = ReColor($color);
$color = ImageColorAllocate($ImageHendle, $dec[0], $dec[1], $dec[2]);
if ($dash == "Y") {
    $style = array($color, $color, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT);
    //$white = ImageColorAllocate($ImageHendle,255,255,255);
    //$style = array ($color,$color,$white,$white,$white);
    ImageSetStyle($ImageHendle, $style);
    ImageLine($ImageHendle, 3, 0, 40, 0, IMG_COLOR_STYLED);
    ImageLine($ImageHendle, 1, 1, 40, 1, IMG_COLOR_STYLED);
} else {
    ImageLine($ImageHendle, 3, 0, 40, 0, $color);
    ImageLine($ImageHendle, 3, 1, 40, 1, $color);
}
/******************************************************
				ќтображаем изображение
*******************************************************/
ShowImageHeader($ImageHendle);
示例#4
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/tools.php";
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/statistic/colors.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/img.php";
// create an image canvas
$ImageHandle = CreateImageHandle(45, 2);
ImageFill($ImageHandle, 0, 0, ImageColorAllocate($ImageHandle, 255, 255, 255));
if (isset($_REQUEST["color"])) {
    $dec = ReColor($_REQUEST["color"]);
} else {
    $dec = 0;
}
if (is_array($dec)) {
    $color = ImageColorAllocate($ImageHandle, $dec[0], $dec[1], $dec[2]);
} else {
    $color = ImageColorAllocate($ImageHandle, 0, 0, 0);
}
if (isset($_REQUEST["dash"]) && $_REQUEST["dash"] == "Y") {
    $style = array($color, $color, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT);
    ImageSetStyle($ImageHandle, $style);
    ImageLine($ImageHandle, 1, 0, 45, 0, IMG_COLOR_STYLED);
    ImageLine($ImageHandle, 1, 1, 45, 1, IMG_COLOR_STYLED);
} else {
    ImageLine($ImageHandle, 0, 0, 45, 0, $color);
    ImageLine($ImageHandle, 0, 1, 45, 1, $color);
}
ShowImageHeader($ImageHandle);