当前位置: 首页>>代码示例>>PHP>>正文


PHP get_image_by_imageid函数代码示例

本文整理汇总了PHP中get_image_by_imageid函数的典型用法代码示例。如果您正苦于以下问题:PHP get_image_by_imageid函数的具体用法?PHP get_image_by_imageid怎么用?PHP get_image_by_imageid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_image_by_imageid函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: paintBackground

 protected function paintBackground()
 {
     $this->canvas->fill($this->options['map']['bgColor']);
     if ($this->mapData['backgroundid'] && ($bgImage = get_image_by_imageid($this->mapData['backgroundid']))) {
         $this->canvas->setBgImage($bgImage['image']);
     }
 }
开发者ID:itnihao,项目名称:Zabbix_,代码行数:7,代码来源:CMapPainter.php

示例2: paintBackground

 protected function paintBackground()
 {
     $this->canvas->fill($this->options['graphtheme']['backgroundcolor']);
     if ($this->mapData['backgroundid']) {
         $image = get_image_by_imageid($this->mapData['backgroundid']);
         if ($image['image']) {
             $this->canvas->setBgImage($image['image']);
         }
     }
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:10,代码来源:CMapPainter.php

示例3: get_png_by_selement

function get_png_by_selement($info)
{
    $image = get_image_by_imageid($info['iconid']);
    return $image['image'] ? imagecreatefromstring($image['image']) : get_default_image();
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:5,代码来源:maps.inc.php

示例4: add_audit

            $audit_action = 'Image [' . $_REQUEST['name'] . '] added';
        }
        if ($result) {
            add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_IMAGE, $audit_action);
            unset($_REQUEST['form']);
        }
        $result = DBend($result);
        show_messages($result, $msgOk, $msgFail);
    } catch (Exception $e) {
        DBend(false);
        error($e->getMessage());
        show_error_message($msgFail);
    }
} elseif (isset($_REQUEST['delete']) && isset($_REQUEST['imageid'])) {
    DBstart();
    $image = get_image_by_imageid($_REQUEST['imageid']);
    $result = API::Image()->delete([getRequest('imageid')]);
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_IMAGE, 'Image [' . $image['name'] . '] deleted');
        unset($_REQUEST['form'], $image, $_REQUEST['imageid']);
    }
    $result = DBend($result);
    show_messages($result, _('Image deleted'), _('Cannot delete image'));
}
/*
 * Display
 */
$data = ['form' => getRequest('form')];
if (!empty($data['form'])) {
    if (isset($_REQUEST['imageid'])) {
        $data['imageid'] = $_REQUEST['imageid'];
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:adm.images.php

示例5: array

require_once "include/config.inc.php";
require_once "include/images.inc.php";
$page['file'] = 'image.php';
$page['title'] = 'S_IMAGE';
$page['type'] = PAGE_TYPE_IMAGE;
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("imageid" => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, NULL), "width" => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(1, 2000), NULL), "height" => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(1, 2000), NULL));
check_fields($fields);
$resize = 0;
if (isset($_REQUEST["width"]) || isset($_REQUEST["height"])) {
    $resize = 1;
    $th_width = get_request('width', 0);
    $th_height = get_request('height', 0);
}
if (!($row = get_image_by_imageid($_REQUEST['imageid']))) {
    error('Incorrect image index');
    include_once "include/page_footer.php";
}
$source = imagecreatefromstring($row['image']);
unset($row);
if ($resize == 1) {
    $src_width = imagesx($source);
    $src_height = imagesy($source);
    if ($src_width > $th_width || $src_height > $th_height) {
        if ($th_width == 0) {
            $th_width = $th_height * $src_width / $src_height;
        } else {
            if ($th_height == 0) {
                $th_height = $th_width * $src_height / $src_width;
            } else {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:image.php

示例6: array

    $images = API::Image()->get(array('filter' => array('imagetype' => IMAGE_TYPE_ICON), 'output' => API_OUTPUT_EXTEND, 'select_image' => 1));
    foreach ($images as $image) {
        $image['image'] = base64_decode($image['image']);
        $ico = imagecreatefromstring($image['image']);
        if ($resize) {
            $ico = imageThumb($ico, $width, $height);
        }
        $w = imagesx($ico);
        $h = imagesy($ico);
        $css .= 'div.sysmap_iconid_' . $image['imageid'] . '{' . ' height: ' . $h . 'px;' . ' width: ' . $w . 'px;' . ' background: url("imgstore.php?iconid=' . $image['imageid'] . '&width=' . $w . '&height=' . $h . '") no-repeat center center;}' . "\n";
    }
    echo $css;
} elseif (isset($_REQUEST['iconid'])) {
    $iconid = get_request('iconid', 0);
    if ($iconid > 0) {
        $image = get_image_by_imageid($iconid);
        $image = $image['image'];
        $source = imageFromString($image);
    } else {
        $source = get_default_image();
    }
    if ($resize) {
        $source = imageThumb($source, $width, $height);
    }
    imageOut($source);
} elseif (isset($_REQUEST['imageid'])) {
    $imageid = get_request('imageid', 0);
    session_start();
    if (isset($_SESSION['image_id'][$imageid])) {
        echo $_SESSION['image_id'][$imageid];
        unset($_SESSION['image_id'][$imageid]);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:imgstore.php

示例7: get_png_by_selement

function get_png_by_selement($selement, $info)
{
    switch ($info['icon_type']) {
        case SYSMAP_ELEMENT_ICON_ON:
            $info['iconid'] = $selement['iconid_on'];
            break;
        case SYSMAP_ELEMENT_ICON_UNKNOWN:
            $info['iconid'] = $selement['iconid_unknown'];
            break;
        case SYSMAP_ELEMENT_ICON_MAINTENANCE:
            $info['iconid'] = $selement['iconid_maintenance'];
            break;
        case SYSMAP_ELEMENT_ICON_DISABLED:
            $info['iconid'] = $selement['iconid_disabled'];
            break;
        case SYSMAP_ELEMENT_ICON_OFF:
        default:
            // element image
            $info['iconid'] = $selement['iconid_off'];
            break;
    }
    // Process for default icons
    if ($info['iconid'] == 0) {
        $info['iconid'] = $selement['iconid_off'];
    }
    //------
    $image = get_image_by_imageid($info['iconid']);
    if (!$image) {
        return get_default_image(true);
    }
    return imagecreatefromstring($image['image']);
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:32,代码来源:maps.inc.php

示例8: imagecolorallocate

$colors['Red'] = imagecolorallocate($im, 255, 0, 0);
$colors['Dark Red'] = imagecolorallocate($im, 150, 0, 0);
$colors['Green'] = imagecolorallocate($im, 0, 255, 0);
$colors['Dark Green'] = imagecolorallocate($im, 0, 150, 0);
$colors['Blue'] = imagecolorallocate($im, 0, 0, 255);
$colors['Dark Blue'] = imagecolorallocate($im, 0, 0, 150);
$colors['Yellow'] = imagecolorallocate($im, 255, 255, 0);
$colors['Dark Yellow'] = imagecolorallocate($im, 150, 150, 0);
$colors['Cyan'] = imagecolorallocate($im, 0, 255, 255);
$colors['Black'] = imagecolorallocate($im, 0, 0, 0);
$colors['Gray'] = imagecolorallocate($im, 150, 150, 150);
$colors['White'] = imagecolorallocate($im, 255, 255, 255);
$x = imagesx($im);
$y = imagesy($im);
imagefilledrectangle($im, 0, 0, $width, $height, $white);
if ($db_image = get_image_by_imageid($backgroundid)) {
    $back = imagecreatefromstring($db_image['image']);
    imagecopy($im, $back, 0, 0, 0, 0, imagesx($back), imagesy($back));
} else {
    $x = imagesx($im) / 2 - ImageFontWidth(4) * strlen($name) / 2;
    imagestring($im, 4, $x, 1, $name, $darkred);
}
unset($db_image);
$str = date('m.d.Y H:i:s', time(NULL));
imagestring($im, 0, imagesx($im) - 120, imagesy($im) - 12, $str, $gray);
if (!isset($_REQUEST['noedit'])) {
    $grid = 50;
    for ($x = $grid; $x < $width; $x += $grid) {
        MyDrawLine($im, $x, 0, $x, $height, $black, MAP_LINK_DRAWTYPE_DASHED_LINE);
        imagestring($im, 2, $x + 2, 2, $x, $black);
    }
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:map.php

示例9: get_png_by_selementid

function get_png_by_selementid($selementid)
{
    $elements = DBselect("select * FROM sysmaps_elements WHERE selementid={$selementid}");
    if (!$elements) {
        return FALSE;
    }
    $element = DBfetch($elements);
    if (!$element) {
        return FALSE;
    }
    $info = get_info_by_selementid($element["selementid"]);
    $image = get_image_by_imageid($info['iconid']);
    if (!$image) {
        return FALSE;
    }
    return imagecreatefromstring($image['image']);
}
开发者ID:rennhak,项目名称:zabbix,代码行数:17,代码来源:maps.inc.php


注:本文中的get_image_by_imageid函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。